From: Gildas Bazin Date: Sat, 1 Mar 2003 23:26:08 +0000 (+0000) Subject: * src/misc/threads.c, include/vlc_threads_funcs.h: fixed gnu-pth thread X-Git-Tag: 0.5.2~68 X-Git-Url: https://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;p=vlc.git;a=commitdiff_plain;h=15f7b18e109a7b495508a144ad3b462d44a595dc;ds=sidebyside * src/misc/threads.c, include/vlc_threads_funcs.h: fixed gnu-pth thread implementation and fixed an initialization bug in libvlc. --- diff --git a/include/vlc_threads_funcs.h b/include/vlc_threads_funcs.h index ddc9037679..8a8e33fab2 100644 --- a/include/vlc_threads_funcs.h +++ b/include/vlc_threads_funcs.h @@ -3,7 +3,7 @@ * This header provides a portable threads implementation. ***************************************************************************** * Copyright (C) 1999, 2002 VideoLAN - * $Id: vlc_threads_funcs.h,v 1.13 2003/01/22 15:16:02 massiot Exp $ + * $Id: vlc_threads_funcs.h,v 1.14 2003/03/01 23:26:08 gbazin Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -73,7 +73,7 @@ static inline int __vlc_mutex_lock( char * psz_file, int i_line, const char * psz_error = ""; #if defined( PTH_INIT_IN_PTH_H ) - i_result = pth_mutex_acquire( &p_mutex->mutex, TRUE, NULL ); + i_result = pth_mutex_acquire( &p_mutex->mutex, FALSE, NULL ); #elif defined( ST_INIT_IN_ST_H ) i_result = st_mutex_lock( p_mutex->mutex ); diff --git a/src/misc/threads.c b/src/misc/threads.c index 78dc219dcc..b4be438c84 100644 --- a/src/misc/threads.c +++ b/src/misc/threads.c @@ -2,7 +2,7 @@ * threads.c : threads implementation for the VideoLAN client ***************************************************************************** * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN - * $Id: threads.c,v 1.36 2003/02/10 16:53:34 sam Exp $ + * $Id: threads.c,v 1.37 2003/03/01 23:26:08 gbazin Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -92,7 +92,6 @@ int __vlc_threads_init( vlc_object_t *p_this ) i_status = VLC_THREADS_PENDING; /* We should be safe now. Do all the initialization stuff we want. */ - vlc_object_create( p_libvlc, VLC_OBJECT_ROOT ); p_libvlc->b_ready = VLC_FALSE; #if defined( PTH_INIT_IN_PTH_H ) @@ -130,6 +129,8 @@ int __vlc_threads_init( vlc_object_t *p_this ) #elif defined( HAVE_KERNEL_SCHEDULER_H ) #endif + vlc_object_create( p_libvlc, VLC_OBJECT_ROOT ); + if( i_ret ) { i_status = VLC_THREADS_ERROR; @@ -686,7 +687,8 @@ int __vlc_thread_create( vlc_object_t *p_this, char * psz_file, int i_line, int __vlc_thread_set_priority( vlc_object_t *p_this, char * psz_file, int i_line, int i_priority ) { -#if defined( WIN32 ) || defined( UNDER_CE ) +#if defined( PTH_INIT_IN_PTH_H ) || defined( ST_INIT_IN_ST_H ) +#elif defined( WIN32 ) || defined( UNDER_CE ) if ( !SetThreadPriority(GetCurrentThread(), i_priority) ) { msg_Warn( p_this, "couldn't set a faster priority" );