[vlc-devel] [PATCH 1/3] Qt: Run mainloop on the main thread on OSX

Juho Vähä-Herttua juhovh at iki.fi
Mon Aug 2 11:59:40 CEST 2010


On 2.8.2010, at 12.21, Rémi Denis-Courmont wrote:
>> So how to proceed in case where libvlc_SetExitHandler is first overridden
>> and then libvlc_Quit() is called during libvlc_add_intf().
> 
> The signal gets posted but it's ignored until sigwait() or
> pthread_sigmask(). 

No it doesn't get posted. :) I just said in case where libvlc_SetExitHandler is _first_ overridden, which means that the vlc_kill never gets called. This includes the Qt4 interface on Mac and also the old Mac OS X interface, which I'm not interested in fixing right now.

> The real problem with the idiotic Apple API is that we cannot run
> sigwait(), so we cannot act on signals.

Main problem is with SIGTERM which is sent by OS from the "Force Quit..." menu item. It's not a big issue, because if the Application doesn't quit after receiving SIGTERM inside some specified timeframe it will be terminated anyway, but should be fixed. I don't think there's other important signals that should be acted on, but could see some documentation about that anyway.

I made a patch that includes the SIGTERM unblock from modules/gui/macosx/intf.m with the respective comment. It also sends a SIGINT on libvlc_Quit to get past the sigwait loop later on, and therefore fixes the issue that commit 4d636fa3a74924691b0b triggered. Patch attached below, please consider including it.


Juho


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Qt-Handle-signals-correctly-on-Mac-OS-X-including-Fo.patch
Type: application/octet-stream
Size: 1724 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100802/0d7ae291/attachment.obj>
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4215 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100802/0d7ae291/attachment.bin>


More information about the vlc-devel mailing list