X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_threads.h;h=f8bd9fb50dbc992bf19503f065b3418fc14d7a99;hb=07c92279a78a42d56d61e5dd6a1026fff33556f5;hp=2da6c34e7c66c852d641cee455f741039e1d47ad;hpb=85b29bdc288a1573d43bd524908be5748a9b3640;p=vlc diff --git a/include/vlc_threads.h b/include/vlc_threads.h index 2da6c34e7c..f8bd9fb50d 100644 --- a/include/vlc_threads.h +++ b/include/vlc_threads.h @@ -2,7 +2,7 @@ * vlc_threads.h : threads implementation for the VideoLAN client * This header provides portable declarations for mutexes & conditions ***************************************************************************** - * Copyright (C) 1999, 2002 VideoLAN (Centrale Réseaux) and its contributors + * Copyright (C) 1999, 2002 the VideoLAN team * $Id$ * * Authors: Jean-Marc Dressler @@ -22,9 +22,16 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#if !defined( __LIBVLC__ ) + #error You are not libvlc or one of its plugins. You cannot include this file +#endif + +#ifndef _VLC_THREADS_H_ +#define _VLC_THREADS_H_ + #include #if defined(DEBUG) && defined(HAVE_SYS_TIME_H) @@ -48,6 +55,9 @@ # include #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) /* pthreads (like Linux & BSD) */ +# define LIBVLC_USE_PTHREAD 1 +# define _APPLE_C_SOURCE 1 /* Proper pthread semantics on OSX */ + # include # ifdef DEBUG /* Needed for pthread_cond_timedwait */ @@ -69,7 +79,7 @@ *****************************************************************************/ /* Thread priorities */ -#ifdef SYS_DARWIN +#ifdef __APPLE__ # define VLC_THREAD_PRIORITY_LOW (-47) # define VLC_THREAD_PRIORITY_INPUT 37 # define VLC_THREAD_PRIORITY_AUDIO 37 @@ -133,6 +143,10 @@ typedef struct pth_cond_t cond; vlc_object_t * p_this; } vlc_cond_t; +typedef struct +{ + int handle; +} vlc_threadvar_t; #elif defined( ST_INIT_IN_ST_H ) typedef st_thread_t vlc_thread_t; @@ -146,6 +160,10 @@ typedef struct st_cond_t cond; vlc_object_t * p_this; } vlc_cond_t; +typedef struct +{ + int handle; +} vlc_threadvar_t; #elif defined( WIN32 ) || defined( UNDER_CE ) typedef HANDLE vlc_thread_t; @@ -176,10 +194,15 @@ typedef struct vlc_object_t * p_this; } vlc_cond_t; +typedef struct +{ + DWORD handle; +} vlc_threadvar_t; + #elif defined( HAVE_KERNEL_SCHEDULER_H ) /* This is the BeOS implementation of the vlc threads, note that the mutex is * not a real mutex and the cond_var is not like a pthread cond_var but it is - * enough for what wee need */ + * enough for what we need */ typedef thread_id vlc_thread_t; @@ -199,6 +222,11 @@ typedef struct vlc_object_t * p_this; } vlc_cond_t; +typedef struct +{ +} vlc_threadvar_t; + + #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) typedef pthread_t vlc_thread_t; typedef struct @@ -212,6 +240,11 @@ typedef struct vlc_object_t * p_this; } vlc_cond_t; +typedef struct +{ + pthread_key_t handle; +} vlc_threadvar_t; + #elif defined( HAVE_CTHREADS_H ) typedef cthread_t vlc_thread_t; @@ -238,5 +271,11 @@ typedef struct vlc_object_t * p_this; } vlc_cond_t; +typedef struct +{ + cthread_key_t handle; +} vlc_threadvar_t; + #endif +#endif