summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-08-01 01:55:07 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-08-01 01:55:07 -0700
commitcf31b1bcbe5b9081470ec67421c78894d59363f6 (patch)
treeda27ad650d4e27f2016a28bfc16ebdf77f5876fd /libs
parentfcaa31bf65bef98f2054f4ba92ac41b4639e6972 (diff)
parent078a2757847dcdd50a254d973d2c9a0556e98d75 (diff)
downloadframeworks_base-cf31b1bcbe5b9081470ec67421c78894d59363f6.zip
frameworks_base-cf31b1bcbe5b9081470ec67421c78894d59363f6.tar.gz
frameworks_base-cf31b1bcbe5b9081470ec67421c78894d59363f6.tar.bz2
Merge change 9397
* changes: Fix Win32 libutils to get a working SDK build.
Diffstat (limited to 'libs')
-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);
}
/*