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

Måns Rullgård mans at mansr.com
Sun Feb 25 21:54:25 CET 2007


Ramiro Polla <angustia at arrozcru.no-ip.org> writes:

> 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)

I don't like this at all.  What happens if the calling app uses the
thread library separately?

-- 
Måns Rullgård
mans at mansr.com

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list