Changes by: Aleksey Nogin (nogin at metaprl.org)
Date: 2007-07-31 13:10:41 -0700 (Tue, 31 Jul 2007)
Revision: 11496
Log message:
[Bug 535] Added a hack to address the "Sys.Break does not get raised inside C
blocking sections" problem (see
http://caml.inria.fr/pub/ml-archives/caml-list/2007/07/3662ad69f77253674f580b174c85dfbb.en.html
for detail).
My "solution" is that when threads are enabled, the Lm_notify.next_event would
run in a child thread, while the master thread periodically (currently - at
0.1s intervals) checks whether it's done. If Ctrl-C is pressed, OCaml will
interrupt the master thread with Sys.Break, which is what we want.
Note that simply having the master thread wait for the child one does not work
- we need the master thread to execute caml_leave_blocking_section()
regularly!
P.S. I have only tested this on Unix with threads enabled, will test on
Windows next.