threads+CNI+SIGINT
Oskar Liljeblad
osk@hem.passagen.se
Sun Mar 26 00:41:00 GMT 2000
I'm playing with ncurses in Java through CNI. There's a demo program,
called Rain, that I translated. It displays ASCII-art raindrops that
later disappears - like a screen saver.
When I compile and run this java program, and interrupt it using CTRL+C,
one thread is not killed - the main thread doing all graphics.
(Resulting in a badly messed up terminal, anyway.) I can kill
the program with killall -9 Rain though, and the raindrops stop.
I'm certainly no expert, but it would seem this problem is related to
the Linux posix thread implementation. Ncurses overwrites the SIGINT
signal - but only if handler is SIG_DFL. This is however true for
the thread which Ncurses is initialized in (main-method thread).
Don't GCJ-compiled programs have some SIGINT handler? If so, why isn't
it installed in the main thread? If not, how is GC cleanup/finalization
done?
Oskar Liljeblad (osk@hem.passagen.se)
More information about the Java
mailing list