]> git.sesse.net Git - vlc/commitdiff
vlc_clone() and vlc_thread_create() must be checked for errors
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 21 May 2009 16:43:30 +0000 (19:43 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 21 May 2009 16:43:30 +0000 (19:43 +0300)
Those two functions can actually fail and leave the handle undefined.
vlc_join() and vlc_thread_join() would then crash (say, be undefined),
so errors should be taken care of explicitly.

include/vlc_threads.h

index 52157d8c287d2382f30d97cf30dc4243991ad51c..52da2b2840cdce67065c61606ffe3424cb25a6e2 100644 (file)
@@ -155,11 +155,11 @@ VLC_EXPORT( int, vlc_threadvar_create, (vlc_threadvar_t * , void (*) (void *) )
 VLC_EXPORT( void, vlc_threadvar_delete, (vlc_threadvar_t *) );
 VLC_EXPORT( int, vlc_threadvar_set, (vlc_threadvar_t, void *) );
 VLC_EXPORT( void *, vlc_threadvar_get, (vlc_threadvar_t) );
-VLC_EXPORT( int,  vlc_thread_create, ( vlc_object_t *, const char *, int, const char *, void * ( * ) ( vlc_object_t * ), int ) );
+VLC_EXPORT( int,  vlc_thread_create, ( vlc_object_t *, const char *, int, const char *, void * ( * ) ( vlc_object_t * ), int ) LIBVLC_USED );
 VLC_EXPORT( int,  __vlc_thread_set_priority, ( vlc_object_t *, const char *, int, int ) );
 VLC_EXPORT( void, __vlc_thread_join,   ( vlc_object_t * ) );
 
-VLC_EXPORT( int, vlc_clone, (vlc_thread_t *, void * (*) (void *), void *, int) );
+VLC_EXPORT( int, vlc_clone, (vlc_thread_t *, void * (*) (void *), void *, int) LIBVLC_USED );
 VLC_EXPORT( void, vlc_cancel, (vlc_thread_t) );
 VLC_EXPORT( void, vlc_join, (vlc_thread_t, void **) );
 VLC_EXPORT (void, vlc_control_cancel, (int cmd, ...));