Closed xavierleroy closed 4 years ago
I don't know whether this PR is the right fix for this code, but I know that the function which is intended to be used for polling signals is caml_process_pending_actions
. Of course, the issue is that it is not backward compatible, so this require some configure
hacking.
Thanks for the tip. We could #if OCAML_VERSION >= 41000
and select the new signal-polling function. But I'd rather avoid to depend on the precise implementation of signal handling in the OCaml runtime system.
LGTM. Just to make sure I understand the logic correctly here, the graphics library handles X events in the signal handler for SIGIO
.
Thanks for the patch!
Just to make sure I understand the logic correctly here, the graphics library handles X events in the signal handler for SIGIO.
That's correct. I'm not sure how long this approach will keep working, but if it breaks there's a "plan B" using threads.
This is a tentative fix for issue #14 .
caml_process_pending_signals
is a function from OCaml's runtime system that disappeared in version 4.10.The reason this function was called in
caml_gr_wait_event_poll
was to process pending X events and merge them in our event queue before the results of the poll are determined.It should be just as good to explicitly purge pending X events instead.