[vlc-devel] commit: vlc: Make sure we call libvlc_release() when we are requested to die. (Pierre d'Herbemont )
rdenis at simphalempin.com
Thu May 15 22:34:24 CEST 2008
Le Thursday 15 May 2008 23:13:25 git version control, vous avez écrit :
> vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Thu
> May 15 22:13:41 2008 +0200| [68bcb6a4322b55b70c231a597d7b45a5406fd7f8]
> vlc: Make sure we call libvlc_release() when we are requested to die.
Hey! I would have done that if it DID work. But... libvlc_release() could be
called multiple times from the signal handing thread -> boom. And it could be
called both in the signal handler thread and in the main thread -> boom.
Of course, could put a spin lock around global vlc variable, but even then,
I'm not convinced that calling libvlc_release() asynchronously while the main
thread is in the early stages of libvlc_run_interface() is safe either.
> Note: I don't think we did yet match the old behaviour, if we hit ctrl-c
> while in libvlc_new(), vlc isn't killed properly.
IMHO, we should not handle Ctrl+C at all. Most GUI program don't. The command
line interface can be closed cleanly with Ctrl+D, and there is always good
old Ctrl+Z for debugging. The daemon mode should perhaps provide its own
signal handling; that's really the only real use case for SIGTERM/SIGINT.
More information about the vlc-devel