[x264-devel] [PATCH] Only init mutexes if threads are being used
Ramiro Polla
ramiro at lisha.ufsc.br
Thu Apr 24 06:08:23 CEST 2008
Hello,
Attached patch makes x264 only init mutexes if threads are being used.
That makes all pthread_ calls depend on threads being actually used at
run-time. Another commit is needed for the indentation afterwards.
A problem that can arise is from programs that use static pthreads-win32
but do not call the initialization code it requires. Currently, it would
always initialize the mutexes (even if they're not used), and crash the
program that did not properly initialize pthreads-win32, even if no
threads were asked for at run-time. With attached patch, if a program
forgets to properly initialize pthreads-win32, the user can still get
away from the crash with not using threads at run-time.
Ramiro Polla
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: x264_mutex.diff
Url: http://mailman.videolan.org/pipermail/x264-devel/attachments/20080424/524be570/attachment.txt
More information about the x264-devel
mailing list