Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace call to caml_process_pending_signals by explicit processing of events #15

Merged
1 commit merged into from
Nov 4, 2019

Conversation

xavierleroy
Copy link
Contributor

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.

…f events

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.

Closes: ocaml#14
@jhjourdan
Copy link

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.

@xavierleroy
Copy link
Contributor Author

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.

@ghost
Copy link

ghost commented Nov 4, 2019

LGTM. Just to make sure I understand the logic correctly here, the graphics library handles X events in the signal handler for SIGIO.

@ghost ghost merged commit b5c3bcf into ocaml:master Nov 4, 2019
@ghost
Copy link

ghost commented Nov 4, 2019

Thanks for the patch!

@xavierleroy
Copy link
Contributor Author

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.

@xavierleroy xavierleroy deleted the no-process-pending-signals branch November 4, 2019 09:02
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants