diff options
| author | Xavier Leroy <xavier.leroy@inria.fr> | 2001-11-20 13:46:11 +0000 |
|---|---|---|
| committer | Xavier Leroy <xavier.leroy@inria.fr> | 2001-11-20 13:46:11 +0000 |
| commit | b337909e4b7396d25b9ce4481b0d80fd9b95e5bd (patch) | |
| tree | 59fddedd642ab3ec6c64db14419ad0141f7af128 | |
| parent | 5242d0edd814272d17a2a027b43757e022603474 (diff) | |
| download | ocaml-b337909e4b7396d25b9ce4481b0d80fd9b95e5bd.tar.gz | |
Glibouillage signaux asynchrones pour Win32
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4026 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
| -rw-r--r-- | byterun/signals.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/byterun/signals.c b/byterun/signals.c index 25920a9edf..d7d91504ce 100644 --- a/byterun/signals.c +++ b/byterun/signals.c @@ -132,6 +132,16 @@ CAMLexport void enter_blocking_section(void) CAMLexport void leave_blocking_section(void) { +#ifdef _WIN32 + /* Under Win32, asynchronous signals such as ctrl-C are not processed + immediately (see ctrl_handler in win32.c), but simply set + pending_signal and let the system call run to completion. + Hence, test pending_signal here and act upon it, before we get + a chance to process the result of the system call. */ + int signal_number = pending_signal; + pending_signal = 0; + if (signal_number) execute_signal(signal_number, 1); +#endif if (leave_blocking_section_hook != NULL) leave_blocking_section_hook(); Assert(async_signal_mode); async_signal_mode = 0; |
