diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2006-09-21 08:04:13 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2006-09-21 08:04:13 +0000 |
commit | fd1109cbb724ade81380969f18935d4ddf92743f (patch) | |
tree | 2504d478f8af08ba395a8b0aee62e3b40ef86860 /otherlibs | |
parent | 6fe04dcbfeaaf06ae7f16a8b2d2347a77c8a78eb (diff) |
PR#4113, tentative fix
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7627 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs')
-rw-r--r-- | otherlibs/win32unix/winwait.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/otherlibs/win32unix/winwait.c b/otherlibs/win32unix/winwait.c index 0a68076b4..bac345b40 100644 --- a/otherlibs/win32unix/winwait.c +++ b/otherlibs/win32unix/winwait.c @@ -41,12 +41,15 @@ static int wait_flag_table[] = { CAML_WNOHANG, CAML_WUNTRACED }; CAMLprim value win_waitpid(value vflags, value vpid_req) { int flags; - DWORD status; + DWORD status, retcode; HANDLE pid_req = (HANDLE) Long_val(vpid_req); flags = convert_flag_list(vflags, wait_flag_table); if ((flags & CAML_WNOHANG) == 0) { - if (WaitForSingleObject(pid_req, INFINITE) == WAIT_FAILED) { + enter_blocking_section(); + retcode = WaitForSingleObject(pid_req, INFINITE); + leave_blocking_section(); + if (retcode == WAIT_FAILED) { win32_maperr(GetLastError()); uerror("waitpid", Nothing); } |