[x264-devel] Re: [PATCH] pthreads-w32 initialization

Ramiro Polla angustia at arrozcru.no-ip.org
Sun Feb 25 21:28:00 CET 2007


Loren Merritt wrote:

> On Sat, 24 Feb 2007, angustia at arrozcru.no-ip.org wrote:
>
>> Currently, the x264 app initializes pthreads-w32 around #ifdef 
>> PTW32_STATIC_LIB. That must be done for the static library.
>>
>> Attached patch also initializes from within the encoder, so that it 
>> also works when x264 is used by another library (e.g. FFmpeg). They 
>> should be able to nest together.
>
>
> Your patch is not re-entrant.

You're right...

> If an application has multiple instances of x264, closing one will 
> crash the others. (Unless it's reference-counted and doesn't actually 
> deinit until you call detach as many times as attach?)

Is it ok to keep the attach count in the library itself? (patch attached)

Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pthread-w32.diff
Type: text/x-patch
Size: 1207 bytes
Desc: not available
Url : http://mailman.videolan.org/pipermail/x264-devel/attachments/20070225/7c271271/attachment.bin 


More information about the x264-devel mailing list