]> git.sesse.net Git - vlc/commitdiff
* src/misc/threads.c, include/vlc_threads_funcs.h: fixed gnu-pth thread
authorGildas Bazin <gbazin@videolan.org>
Sat, 1 Mar 2003 23:26:08 +0000 (23:26 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sat, 1 Mar 2003 23:26:08 +0000 (23:26 +0000)
   implementation and fixed an initialization bug in libvlc.

include/vlc_threads_funcs.h
src/misc/threads.c

index ddc9037679af2a6a5d3e2a6533693a177ce49a1c..8a8e33fab233221ad803315d0149d4fe096d264f 100644 (file)
@@ -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 <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -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 );
index 78dc219dcc48690f25c1d4d7afa6adb8bbf18cc7..b4be438c8481a573fc99ce056772f03d16e73f81 100644 (file)
@@ -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 <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -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" );