diff options
author | Martin v. L?wis <martin@v.loewis.de> | 2013-01-25 14:25:48 +0100 |
---|---|---|
committer | Martin v. L?wis <martin@v.loewis.de> | 2013-01-25 14:25:48 +0100 |
commit | 729167bcaa47901b4918cf6148f27cb97fa23726 (patch) | |
tree | 937389929caaab3522d2779750a9382b2d4e4180 | |
parent | 8b27f0efd0c64adf15140fd4fa2856da224cf62e (diff) | |
download | cpython-729167bcaa47901b4918cf6148f27cb97fa23726.tar.gz |
Replace WaitForSingleObject with WaitForSingleObjectEx,
for better WinRT compatibility.
-rw-r--r-- | Modules/_multiprocessing/semaphore.c | 4 | ||||
-rw-r--r-- | Modules/timemodule.c | 2 | ||||
-rw-r--r-- | PC/launcher.c | 2 | ||||
-rw-r--r-- | Parser/myreadline.c | 2 | ||||
-rw-r--r-- | Python/condvar.h | 2 | ||||
-rw-r--r-- | Python/thread_nt.h | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c index eb3fa0ceb5..bdf56a9f73 100644 --- a/Modules/_multiprocessing/semaphore.c +++ b/Modules/_multiprocessing/semaphore.c @@ -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; diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 8a81c8cf1e..d5ffdcccba 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -1574,7 +1574,7 @@ floatsleep(double secs) 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 dfad44a359..df2580b337 100644 --- a/PC/launcher.c +++ b/PC/launcher.c @@ -535,7 +535,7 @@ run_child(wchar_t * cmdline) 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 d864623f1a..8b27045f1d 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -68,7 +68,7 @@ my_fgets(char *buf, int len, FILE *fp) */ 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 fe6bd74da8..72b08f98c0 100644 --- a/Python/condvar.h +++ b/Python/condvar.h @@ -242,7 +242,7 @@ _PyCOND_WAIT_MS(PyCOND_T *cv, PyMUTEX_T *cs, DWORD ms) * 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 938bf1e3fe..bd604fbdd3 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -130,7 +130,7 @@ FreeNonRecursiveMutex(PNRMUTEX mutex) DWORD EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds) { - return WaitForSingleObject(mutex, milliseconds); + return WaitForSingleObjectEx(mutex, milliseconds, FALSE); } BOOL |