[vlc-devel] [PATCH] Use Mach semaphores on Mac OS X

Juho Vähä-Herttua juhovh at iki.fi
Thu May 6 15:15:39 CEST 2010


On 6.5.2010, at 15.07, Juho Vähä-Herttua wrote:
> I attached a patch that implements Mach semaphores on OSX instead of the POSIX semaphores, fixes avcodec module on master. Tested with several video files on OSX, but could test it on other platforms as well to make sure it doesn't break anything. Doesn't check for the EINTR, because I'm not sure what would be the equivalent or if signals affect semaphores in the first place.

There's one problem with the patch. It calls for VLC_THREAD_ASSERT that calls vlc_thread_fatal on debug, which in turn calls strerror_r, which fails because the return value is not errno value but instead kern_return_t. ILEoo also mentioned that after semaphore_destroy the condition should be val == KERN_SUCCESS instead of != check.

I will try to fix these first, other comments are welcome.


Juho




More information about the vlc-devel mailing list