[vlc-devel] [PATCH 6/6] os2: thread: support static condition variable

Rémi Denis-Courmont remi at remlab.net
Thu Jun 11 13:15:14 CEST 2015


Le 2015-06-11 13:58, KO Myung-Hun a écrit :
>>> +static vlc_static_cond_t *static_condvar_start = NULL;
>>> +
>>> +static void vlc_static_cond_init (vlc_cond_t *p_condvar)
>>> +{
>>> +    vlc_mutex_lock (&super_mutex);
>>> +
>>> +    if (p_condvar->hev == NULLHANDLE)
>>> +    {
>>> +        vlc_cond_init_common (p_condvar, p_condvar->clock);
>>> +
>>> +        vlc_static_cond_t *new_static_condvar;
>>> +
>>> +        new_static_condvar = malloc (sizeof 
>>> (*new_static_condvar));
>>> +        if (unlikely (!new_static_condvar))
>>> +            abort();
>>> +
>>> +        memcpy (&new_static_condvar->condvar, p_condvar, sizeof
>>> (*p_condvar));
>>> +        new_static_condvar->next = static_condvar_start;
>>> +        static_condvar_start = new_static_condvar;
>>
>> Won´t this leave stale pointers after dlclose() and crash in
>> vlc_static_cond_destroy_all()?
>
> On OS/2, termination codes of _DLL_InitTerm() is called when calling
> dlclose(). So if you call dlclose(), vlc_static_cond_destroy_all() 
> will
> be executed before DLL is unloaded.

Libvlccore, maybe. I don't see how vlc_static_cond_destroy_all() gets 
invoked when closing a VLC module.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list