Replace WaitForSingleObject with WaitForSingleObjectEx,

for better WinRT compatibility.
This commit is contained in:
Martin v. Löwis 2013-01-25 14:25:48 +01:00
parent 3f50bf652b
commit b26a9b10ea
6 changed files with 7 additions and 7 deletions

View file

@ -43,7 +43,7 @@ _GetSemaphoreValue(HANDLE handle, long *value)
{
long previous;
switch (WaitForSingleObject(handle, 0)) {
switch (WaitForSingleObjectEx(handle, 0, FALSE)) {
case WAIT_OBJECT_0:
if (!ReleaseSemaphore(handle, 1, &previous))
return MP_STANDARD_ERROR;
@ -99,7 +99,7 @@ semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds)
}
/* check whether we can acquire without releasing the GIL and blocking */
if (WaitForSingleObject(self->handle, 0) == WAIT_OBJECT_0) {
if (WaitForSingleObjectEx(self->handle, 0, FALSE) == WAIT_OBJECT_0) {
self->last_tid = GetCurrentThreadId();
++self->count;
Py_RETURN_TRUE;