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

Bug in the Unix.sleep when used after Graphics.synchronize #3666

Closed
vicuna opened this issue May 27, 2005 · 2 comments
Closed

Bug in the Unix.sleep when used after Graphics.synchronize #3666

vicuna opened this issue May 27, 2005 · 2 comments

Comments

@vicuna
Copy link

vicuna commented May 27, 2005

Original bug ID: 3666
Reporter: administrator
Status: acknowledged
Resolution: open
Priority: normal
Severity: feature
Category: otherlibs
Monitored by: @Chris00

Bug description

Full_Name: Damien Bobillot
Version: 3.08.3
OS: Linux (Redhat & Gentoo)
Submission from: 132.227.81.31 (132.227.81.31)

==== test.ml ====
Graphics.open_graph "";
Graphics.synchronize ();
Printf.printf "cou%!";
Unix.sleep 60;
Printf.printf "cou\n%!";

ocamlopt.opt -c test unix.cmxa graphics.cmxa test.ml

When running ./test, the program dont wait 1 minute between printf "cou" calls.

This bug doesn't appear in the Mac OS X version.

I've tried to block all signals (with Unix.sigprocmask Unix.SIG_SETMASK
[-1;-2;...;-20;-21]), but it doesn't solve anything.

@vicuna
Copy link
Author

vicuna commented Jul 20, 2005

Comment author: administrator

It's not a bug, it's a SIGIO signal that interrupts Unix.sleep (under Unix --
MacOS X restarts the syscall). Feature wish: a Graphics library that does not
use signals (but e.g. threads).

@xavierleroy
Copy link
Contributor

Since 4.07, Unix.sleep is resilient to interrupts. This seems to solve this old issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants