* This header provides a portable threads implementation.
*****************************************************************************
* Copyright (C) 1999, 2002 VideoLAN
- * $Id: vlc_threads_funcs.h,v 1.14 2003/03/01 23:26:08 gbazin Exp $
+ * $Id: vlc_threads_funcs.h,v 1.15 2003/03/02 01:35:30 gbazin Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
const char * psz_error = "";
#if defined( PTH_INIT_IN_PTH_H )
- i_result = pth_mutex_acquire( &p_mutex->mutex, FALSE, NULL );
+ i_result = ( pth_mutex_acquire( &p_mutex->mutex, FALSE, NULL ) == FALSE );
#elif defined( ST_INIT_IN_ST_H )
i_result = st_mutex_lock( p_mutex->mutex );
const char * psz_error = "";
#if defined( PTH_INIT_IN_PTH_H )
- i_result = pth_mutex_release( &p_mutex->mutex );
+ i_result = ( pth_mutex_release( &p_mutex->mutex ) == FALSE );
#elif defined( ST_INIT_IN_ST_H )
i_result = st_mutex_unlock( p_mutex->mutex );
const char * psz_error = "";
#if defined( PTH_INIT_IN_PTH_H )
- i_result = pth_cond_notify( &p_condvar->cond, FALSE );
+ i_result = ( pth_cond_notify( &p_condvar->cond, FALSE ) == FALSE );
#elif defined( ST_INIT_IN_ST_H )
i_result = st_cond_signal( p_condvar->cond );
const char * psz_error = "";
#if defined( PTH_INIT_IN_PTH_H )
- i_result = pth_cond_notify( &p_condvar->cond, FALSE );
+ i_result = ( pth_cond_notify( &p_condvar->cond, TRUE ) == FALSE );
#elif defined( ST_INIT_IN_ST_H )
i_result = st_cond_broadcast( p_condvar->cond );
const char * psz_error = "";
#if defined( PTH_INIT_IN_PTH_H )
- i_result = pth_cond_await( &p_condvar->cond, &p_mutex->mutex, NULL );
+ i_result = ( pth_cond_await( &p_condvar->cond, &p_mutex->mutex, NULL )
+ == FALSE );
#elif defined( ST_INIT_IN_ST_H )
st_mutex_unlock( p_mutex->mutex );
* threads.c : threads implementation for the VideoLAN client
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: threads.c,v 1.37 2003/03/01 23:26:08 gbazin Exp $
+ * $Id: threads.c,v 1.38 2003/03/02 01:35:30 gbazin Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
p_libvlc->b_ready = VLC_FALSE;
#if defined( PTH_INIT_IN_PTH_H )
- i_ret = pth_init();
+ i_ret = ( pth_init() == FALSE );
#elif defined( ST_INIT_IN_ST_H )
i_ret = st_init();
i_initializations--;
if( i_initializations == 0 )
{
- return pth_kill();
+ return ( pth_kill() == FALSE );
}
#elif defined( ST_INIT_IN_ST_H )
p_mutex->p_this = p_this;
#if defined( PTH_INIT_IN_PTH_H )
- return pth_mutex_init( &p_mutex->mutex );
+ return ( pth_mutex_init( &p_mutex->mutex ) == FALSE );
#elif defined( ST_INIT_IN_ST_H )
p_mutex->mutex = st_mutex_new();
p_condvar->p_this = p_this;
#if defined( PTH_INIT_IN_PTH_H )
- return pth_cond_init( &p_condvar->cond );
+ return ( pth_cond_init( &p_condvar->cond ) == FALSE );
#elif defined( ST_INIT_IN_ST_H )
p_condvar->cond = st_cond_new();
#if defined( PTH_INIT_IN_PTH_H )
p_this->thread_id = pth_spawn( PTH_ATTR_DEFAULT, func, p_data );
- i_ret = 0;
+ i_ret = p_this->thread_id == NULL;
#elif defined( ST_INIT_IN_ST_H )
p_this->thread_id = st_thread_create( func, p_data, 1, 0 );
int i_ret = 0;
#if defined( PTH_INIT_IN_PTH_H )
- i_ret = pth_join( p_this->thread_id, NULL );
+ i_ret = ( pth_join( p_this->thread_id, NULL ) == FALSE );
#elif defined( ST_INIT_IN_ST_H )
i_ret = st_thread_join( p_this->thread_id, NULL );