summaryrefslogtreecommitdiffstats
path: root/libs/utils
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-08-01 00:20:17 +0200
committerDavid 'Digit' Turner <digit@google.com>2009-08-01 10:53:29 +0200
commit429db150affcc99b198fa0da52165fde4cd4cc7c (patch)
tree4305296c2a077f11e0bbfdbc714566bc99dfaba9 /libs/utils
parent60da4f44f1c1978839464919371834de2cb1fc62 (diff)
downloadframeworks_native-429db150affcc99b198fa0da52165fde4cd4cc7c.zip
frameworks_native-429db150affcc99b198fa0da52165fde4cd4cc7c.tar.gz
frameworks_native-429db150affcc99b198fa0da52165fde4cd4cc7c.tar.bz2
Fix Win32 libutils to get a working SDK build.
Diffstat (limited to 'libs/utils')
-rw-r--r--libs/utils/Threads.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index 4036c49..6be372c 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -296,6 +296,19 @@ Mutex::Mutex(const char* name)
// XXX: name not used for now
HANDLE hMutex;
+ assert(sizeof(hMutex) == sizeof(mState));
+
+ hMutex = CreateMutex(NULL, FALSE, NULL);
+ mState = (void*) hMutex;
+}
+
+Mutex::Mutex(int type, const char* name)
+{
+ // XXX: type and name not used for now
+ HANDLE hMutex;
+
+ assert(sizeof(hMutex) == sizeof(mState));
+
hMutex = CreateMutex(NULL, FALSE, NULL);
mState = (void*) hMutex;
}
@@ -486,7 +499,11 @@ status_t Condition::wait(Mutex& mutex)
status_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime)
{
- return wait(mutex, systemTime()+reltime);
+ WinCondition* condState = (WinCondition*) mState;
+ HANDLE hMutex = (HANDLE) mutex.mState;
+ nsecs_t absTime = systemTime()+reltime;
+
+ return ((WinCondition*)mState)->wait(condState, hMutex, &absTime);
}
/*