X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_threads.h;h=3df206b4a658a957e21c64e681a5e51f3ed380d9;hb=b0536abaa69367da6abdfd1b9e872c3ee8c4dec5;hp=4bcabb18544102bfa6c88003b0bdd2e0e1dd5925;hpb=695659b311c26fab0517c4e71e4a866d31d7f8cb;p=vlc diff --git a/include/vlc_threads.h b/include/vlc_threads.h index 4bcabb1854..3df206b4a6 100644 --- a/include/vlc_threads.h +++ b/include/vlc_threads.h @@ -3,7 +3,7 @@ * This header provides portable declarations for mutexes & conditions ***************************************************************************** * Copyright (C) 1999, 2002 VideoLAN - * $Id: vlc_threads.h,v 1.33 2003/08/28 17:19:42 sam Exp $ + * $Id: vlc_threads.h,v 1.37 2004/03/01 12:50:39 gbazin Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -14,7 +14,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -42,6 +42,11 @@ #elif defined( WIN32 ) # include /* Win32 API */ +#elif defined( HAVE_KERNEL_SCHEDULER_H ) /* BeOS */ +# include +# include +# include + #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) /* pthreads (like Linux & BSD) */ # include # ifdef DEBUG @@ -54,11 +59,6 @@ #elif defined( HAVE_CTHREADS_H ) /* GNUMach */ # include -#elif defined( HAVE_KERNEL_SCHEDULER_H ) /* BeOS */ -# include -# include -# include - #else # error no threads available on your system ! @@ -76,11 +76,25 @@ # define VLC_THREAD_PRIORITY_VIDEO (-47) # define VLC_THREAD_PRIORITY_OUTPUT 37 +#elif defined(SYS_BEOS) +# define VLC_THREAD_PRIORITY_LOW 5 +# define VLC_THREAD_PRIORITY_INPUT 10 +# define VLC_THREAD_PRIORITY_AUDIO 10 +# define VLC_THREAD_PRIORITY_VIDEO 5 +# define VLC_THREAD_PRIORITY_OUTPUT 15 + +#elif defined(PTHREAD_COND_T_IN_PTHREAD_H) +# define VLC_THREAD_PRIORITY_LOW 0 +# define VLC_THREAD_PRIORITY_INPUT 20 +# define VLC_THREAD_PRIORITY_AUDIO 10 +# define VLC_THREAD_PRIORITY_VIDEO 0 +# define VLC_THREAD_PRIORITY_OUTPUT 30 + #elif defined(WIN32) || defined(UNDER_CE) /* Define different priorities for WinNT/2K/XP and Win9x/Me */ # define VLC_THREAD_PRIORITY_LOW 0 # define VLC_THREAD_PRIORITY_INPUT \ - (IS_WINNT ? THREAD_PRIORITY_TIME_CRITICAL : 0) + (IS_WINNT ? THREAD_PRIORITY_ABOVE_NORMAL : 0) # define VLC_THREAD_PRIORITY_AUDIO \ (IS_WINNT ? THREAD_PRIORITY_HIGHEST : 0) # define VLC_THREAD_PRIORITY_VIDEO \ @@ -90,13 +104,6 @@ # define VLC_THREAD_PRIORITY_HIGHEST \ (IS_WINNT ? THREAD_PRIORITY_TIME_CRITICAL : 0) -#elif defined(SYS_BEOS) -# define VLC_THREAD_PRIORITY_LOW 5 -# define VLC_THREAD_PRIORITY_INPUT 10 -# define VLC_THREAD_PRIORITY_AUDIO 10 -# define VLC_THREAD_PRIORITY_VIDEO 5 -# define VLC_THREAD_PRIORITY_OUTPUT 15 - #else # define VLC_THREAD_PRIORITY_LOW 0 # define VLC_THREAD_PRIORITY_INPUT 0 @@ -165,6 +172,29 @@ typedef struct vlc_object_t * p_this; } vlc_cond_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 */ + +typedef thread_id vlc_thread_t; + +typedef struct +{ + int32_t init; + sem_id lock; + + vlc_object_t * p_this; +} vlc_mutex_t; + +typedef struct +{ + int32_t init; + thread_id thread; + + vlc_object_t * p_this; +} vlc_cond_t; + #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) typedef pthread_t vlc_thread_t; typedef struct @@ -204,28 +234,5 @@ typedef struct vlc_object_t * p_this; } vlc_cond_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 */ - -typedef thread_id vlc_thread_t; - -typedef struct -{ - int32 init; - sem_id lock; - - vlc_object_t * p_this; -} vlc_mutex_t; - -typedef struct -{ - int32 init; - thread_id thread; - - vlc_object_t * p_this; -} vlc_cond_t; - #endif