Replace WaitForSingleObject with WaitForSingleObjectEx,
for better WinRT compatibility.
diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c
index eb3fa0c..bdf56a9 100644
--- a/Modules/_multiprocessing/semaphore.c
+++ b/Modules/_multiprocessing/semaphore.c
@@ -43,7 +43,7 @@
{
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 @@
}
/* 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;
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 8a81c8c..d5ffdcc 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -1574,7 +1574,7 @@
DWORD rc;
HANDLE hInterruptEvent = _PyOS_SigintEvent();
ResetEvent(hInterruptEvent);
- rc = WaitForSingleObject(hInterruptEvent, ul_millis);
+ rc = WaitForSingleObjectEx(hInterruptEvent, ul_millis, FALSE);
if (rc == WAIT_OBJECT_0) {
Py_BLOCK_THREADS
errno = EINTR;
diff --git a/PC/launcher.c b/PC/launcher.c
index dfad44a..df2580b 100644
--- a/PC/launcher.c
+++ b/PC/launcher.c
@@ -535,7 +535,7 @@
error(RC_CREATE_PROCESS, L"Unable to create process using '%s'", cmdline);
AssignProcessToJobObject(job, pi.hProcess);
CloseHandle(pi.hThread);
- WaitForSingleObject(pi.hProcess, INFINITE);
+ WaitForSingleObjectEx(pi.hProcess, INFINITE, FALSE);
ok = GetExitCodeProcess(pi.hProcess, &rc);
if (!ok)
error(RC_CREATE_PROCESS, L"Failed to get exit code of process");
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index d864623..8b27045 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -68,7 +68,7 @@
*/
if (GetLastError()==ERROR_OPERATION_ABORTED) {
hInterruptEvent = _PyOS_SigintEvent();
- switch (WaitForSingleObject(hInterruptEvent, 10)) {
+ switch (WaitForSingleObjectEx(hInterruptEvent, 10, FALSE)) {
case WAIT_OBJECT_0:
ResetEvent(hInterruptEvent);
return 1; /* Interrupt */
diff --git a/Python/condvar.h b/Python/condvar.h
index fe6bd74..72b08f9 100644
--- a/Python/condvar.h
+++ b/Python/condvar.h
@@ -242,7 +242,7 @@
* but we are safe because we are using a semaphore wich has an internal
* count.
*/
- wait = WaitForSingleObject(cv->sem, ms);
+ wait = WaitForSingleObjectEx(cv->sem, ms, FALSE);
PyMUTEX_LOCK(cs);
if (wait != WAIT_OBJECT_0)
--cv->waiting;
diff --git a/Python/thread_nt.h b/Python/thread_nt.h
index 938bf1e..bd604fb 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -130,7 +130,7 @@
DWORD
EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
{
- return WaitForSingleObject(mutex, milliseconds);
+ return WaitForSingleObjectEx(mutex, milliseconds, FALSE);
}
BOOL