[vlc-devel] commit: objects: Call vlc_object_join() automatically from vlc_object_destructor() if needed. (Pierre d'Herbemont )
Pierre d'Herbemont
pdherbemont at free.fr
Tue Mar 25 11:02:21 CET 2008
On Mar 25, 2008, at 10:03 AM, Rafaël Carré wrote:
> 2008/3/23, git version control <git at videolan.org>:
>> vlc | branch: master | Pierre d'Herbemont
>> <pdherbemont at videolan.org> | Sun Mar 23 01:15:54 2008 +0100|
>> [05dc64af7e19036bbf6fa538345b5a2278a1d91f]
>>
>> objects: Call vlc_object_join() automatically from
>> vlc_object_destructor() if needed.
>> interaction: No need to call vlc_object_join() now.
>>
>>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=05dc64af7e19036bbf6fa538345b5a2278a1d91f
>
>> @@ -419,6 +420,10 @@ static void vlc_object_destroy( vlc_object_t
>> *p_this )
>> /* Send a kill to the object's thread if applicable */
>> vlc_object_kill( p_this );
>>
>> + /* If we are running on a thread, wait until it ends */
>> + if( p_priv->b_thread )
>> + vlc_thread_join( p_this );
>> +
>
> If a thread calls vlc_object_release() to destroy itself, there is an
> obvious deadlock, and vlc_thread_join() fails loudly.
pthread_join() should not dead lock and return EDEADLK. On Windows, I
don't know.
Pierre.
More information about the vlc-devel
mailing list