Replace WaitForSingleObject with WaitForSingleObjectEx, · pythoncapi/cpython@b26a9b1 · GitHub
Skip to content

Commit b26a9b1

Browse files
committed
Replace WaitForSingleObject with WaitForSingleObjectEx,
for better WinRT compatibility.
1 parent 3f50bf6 commit b26a9b1

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

Modules/_multiprocessing/semaphore.c

Lines changed: 2 additions & 2 deletions

Modules/timemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ floatsleep(double secs)
15741574
DWORD rc;
15751575
HANDLE hInterruptEvent = _PyOS_SigintEvent();
15761576
ResetEvent(hInterruptEvent);
1577-
rc = WaitForSingleObject(hInterruptEvent, ul_millis);
1577+
rc = WaitForSingleObjectEx(hInterruptEvent, ul_millis, FALSE);
15781578
if (rc == WAIT_OBJECT_0) {
15791579
Py_BLOCK_THREADS
15801580
errno = EINTR;

PC/launcher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ run_child(wchar_t * cmdline)
535535
error(RC_CREATE_PROCESS, L"Unable to create process using '%s'", cmdline);
536536
AssignProcessToJobObject(job, pi.hProcess);
537537
CloseHandle(pi.hThread);
538-
WaitForSingleObject(pi.hProcess, INFINITE);
538+
WaitForSingleObjectEx(pi.hProcess, INFINITE, FALSE);
539539
ok = GetExitCodeProcess(pi.hProcess, &rc);
540540
if (!ok)
541541
error(RC_CREATE_PROCESS, L"Failed to get exit code of process");

Parser/myreadline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ my_fgets(char *buf, int len, FILE *fp)
6868
*/
6969
if (GetLastError()==ERROR_OPERATION_ABORTED) {
7070
hInterruptEvent = _PyOS_SigintEvent();
71-
switch (WaitForSingleObject(hInterruptEvent, 10)) {
71+
switch (WaitForSingleObjectEx(hInterruptEvent, 10, FALSE)) {
7272
case WAIT_OBJECT_0:
7373
ResetEvent(hInterruptEvent);
7474
return 1; /* Interrupt */

Python/condvar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ _PyCOND_WAIT_MS(PyCOND_T *cv, PyMUTEX_T *cs, DWORD ms)
242242
* but we are safe because we are using a semaphore wich has an internal
243243
* count.
244244
*/
245-
wait = WaitForSingleObject(cv->sem, ms);
245+
wait = WaitForSingleObjectEx(cv->sem, ms, FALSE);
246246
PyMUTEX_LOCK(cs);
247247
if (wait != WAIT_OBJECT_0)
248248
--cv->waiting;

Python/thread_nt.h

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)