THREAD_LIB=""
fi
-dnl Check for cthreads under GNU/Hurd for instance
-AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
-
VLC_ADD_LIBS([libvlc plugin],[${THREAD_LIB}])
-dnl Don't link with rt when using GNU-pth
AC_CHECK_LIB(rt, clock_nanosleep, [
VLC_ADD_LIBS([libvlc],[-lrt])
AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define to 1 if you have clock_nanosleep.])
dnl Check for threads library
if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
-AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
+AC_CHECK_HEADERS(pthread.h kernel/scheduler.h kernel/OS.h)
fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
dnl Find where are the X headers and libraries
/* This is not prototyped under Linux, though it exists. */
int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
-#elif defined( HAVE_CTHREADS_H ) /* GNUMach */
-# include <cthreads.h>
-
#else
# error no threads available on your system !
pthread_key_t handle;
} vlc_threadvar_t;
-#elif defined( HAVE_CTHREADS_H )
-typedef cthread_t vlc_thread_t;
-
-/* Those structs are the ones defined in /include/cthreads.h but we need
- * to handle (&foo) where foo is a (mutex_t) while they handle (foo) where
- * foo is a (mutex_t*) */
-typedef struct
-{
- spin_lock_t held;
- spin_lock_t lock;
- char *name;
- struct cthread_queue queue;
-
- vlc_object_t * p_this;
-} vlc_mutex_t;
-
-typedef struct
-{
- spin_lock_t lock;
- struct cthread_queue queue;
- char *name;
- struct cond_imp *implications;
-
- vlc_object_t * p_this;
-} vlc_cond_t;
-
-typedef struct
-{
- cthread_key_t handle;
-} vlc_threadvar_t;
-
#endif
-#endif
+#endif /* !_VLC_THREADS_H */
errno = i_result;
}
-#elif defined( HAVE_CTHREADS_H )
- mutex_lock( p_mutex->mutex );
- i_result = 0;
-
#endif
if( i_result )
errno = i_result;
}
-#elif defined( HAVE_CTHREADS_H )
- mutex_unlock( p_mutex );
- i_result = 0;
-
#endif
if( i_result )
errno = i_result;
}
-#elif defined( HAVE_CTHREADS_H )
- /* condition_signal() */
- if ( p_condvar->queue.head || p_condvar->implications )
- {
- cond_signal( (condition_t)p_condvar );
- }
- i_result = 0;
-
#endif
if( i_result )
errno = i_result;
}
-#elif defined( HAVE_CTHREADS_H )
- condition_wait( (condition_t)p_condvar, (mutex_t)p_mutex );
- i_result = 0;
-
#endif
if( i_result )
errno = i_res;
}
-#elif defined( HAVE_CTHREADS_H )
-# error Unimplemented
#endif
if( i_res )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
i_ret = pthread_setspecific( p_tls->handle, p_value );
-#elif defined( HAVE_CTHREADS_H )
- i_ret = cthread_setspecific( p_tls->handle, p_value );
#endif
return i_ret;
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
p_ret = pthread_getspecific( p_tls->handle );
-#elif defined( HAVE_CTHREADS_H )
- if ( !cthread_getspecific( p_tls->handle, &p_ret ) )
- {
- p_ret = NULL;
- }
#endif
return p_ret;
#elif defined( HAVE_KERNEL_SCHEDULER_H )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER;
-#elif defined( HAVE_CTHREADS_H )
#endif
vlc_threadvar_t msg_context_global_key;
#elif defined( HAVE_KERNEL_SCHEDULER_H )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
pthread_mutex_lock( &once_mutex );
-#elif defined( HAVE_CTHREADS_H )
#endif
if( i_status == VLC_THREADS_UNINITIALIZED )
#elif defined( HAVE_KERNEL_SCHEDULER_H )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
-#elif defined( HAVE_CTHREADS_H )
#endif
p_root = vlc_object_create( p_libvlc_global, VLC_OBJECT_GLOBAL );
while( i_status == VLC_THREADS_PENDING ) msleep( THREAD_SLEEP );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
pthread_mutex_unlock( &once_mutex );
-#elif defined( HAVE_CTHREADS_H )
- while( i_status == VLC_THREADS_PENDING ) msleep( THREAD_SLEEP );
#endif
if( i_status != VLC_THREADS_READY )
#elif defined( HAVE_KERNEL_SCHEDULER_H )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
pthread_mutex_lock( &once_mutex );
-#elif defined( HAVE_CTHREADS_H )
#endif
if( i_initializations == 0 )
#elif defined( HAVE_KERNEL_SCHEDULER_H )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
pthread_mutex_unlock( &once_mutex );
-#elif defined( HAVE_CTHREADS_H )
#endif
return VLC_SUCCESS;
}
# endif
return pthread_mutex_init( &p_mutex->mutex, NULL );
-#elif defined( HAVE_CTHREADS_H )
- mutex_init( p_mutex );
- return 0;
-
#endif
}
errno = i_result;
}
-#elif defined( HAVE_CTHREADS_H )
- return 0;
-
#endif
if( i_result )
pthread_condattr_destroy (&attr);
return ret;
-#elif defined( HAVE_CTHREADS_H )
- /* condition_init() */
- spin_lock_init( &p_condvar->lock );
- cthread_queue_init( &p_condvar->queue );
- p_condvar->name = 0;
- p_condvar->implications = 0;
-
- return 0;
-
#endif
}
errno = i_result;
}
-#elif defined( HAVE_CTHREADS_H )
- return 0;
-
#endif
if( i_result )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
i_ret = pthread_key_create( &p_tls->handle, NULL );
-#elif defined( HAVE_CTHREADS_H )
- i_ret = cthread_keycreate( &p_tls-handle );
#endif
return i_ret;
}
}
#endif
-#elif defined( HAVE_CTHREADS_H )
- p_priv->thread_id = cthread_fork( (cthread_fn_t)func, (any_t)p_data );
- i_ret = 0;
-
#endif
if( i_ret == 0 )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
i_ret = pthread_join( p_priv->thread_id, NULL );
-#elif defined( HAVE_CTHREADS_H )
- cthread_join( p_priv->thread_id );
- i_ret = 1;
-
#endif
if( i_ret )