diff options
| author | 2009-08-01 01:55:07 -0700 | |
|---|---|---|
| committer | 2009-08-01 01:55:07 -0700 | |
| commit | 4851d01930df752cfab14f70a44154146394d24c (patch) | |
| tree | 7aeb7d530ddf0219b90296f4cdb1d39e314844ec | |
| parent | f3b19c40129bf963b14020bddd757402d4b7a2dd (diff) | |
| parent | 429db150affcc99b198fa0da52165fde4cd4cc7c (diff) | |
Merge change 9397
* changes:
Fix Win32 libutils to get a working SDK build.
| -rw-r--r-- | libs/utils/Threads.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp index 4036c497a4..6be372c87e 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); } /* |