* This header provides portable declarations for mutexes & conditions
*****************************************************************************
* Copyright (C) 1999, 2002 VideoLAN
- * $Id: vlc_threads.h,v 1.14 2002/10/08 22:48:25 massiot Exp $
+ * $Id: vlc_threads.h,v 1.20 2003/01/05 16:23:57 massiot Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
#include <stdio.h>
#if defined(GPROF) || defined(DEBUG)
-# include <sys/time.h>
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# endif
#endif
#if defined( PTH_INIT_IN_PTH_H ) /* GNU Pth */
#elif defined( ST_INIT_IN_ST_H ) /* State threads */
# include <st.h>
-#elif defined( WIN32 ) /* Win32 API */
-# include <process.h>
+#elif defined( UNDER_CE )
+ /* WinCE API */
+#elif defined( WIN32 )
+# include <process.h> /* Win32 API */
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) /* pthreads (like Linux & BSD) */
# include <pthread.h>
/* Thread priorities */
#ifdef SYS_DARWIN
# define VLC_THREAD_PRIORITY_LOW 31
-# define VLC_THREAD_PRIORITY_INPUT 37
-# define VLC_THREAD_PRIORITY_AUDIO 38
+# define VLC_THREAD_PRIORITY_INPUT 35
+# define VLC_THREAD_PRIORITY_AUDIO 36
# define VLC_THREAD_PRIORITY_VIDEO 31
-# define VLC_THREAD_PRIORITY_OUTPUT 38
+# define VLC_THREAD_PRIORITY_OUTPUT 31
-#elif defined(WIN32)
+#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 THREAD_PRIORITY_ABOVE_NORMAL
-# define VLC_THREAD_PRIORITY_AUDIO THREAD_PRIORITY_ABOVE_NORMAL
+# define VLC_THREAD_PRIORITY_INPUT \
+ (IS_WINNT ? THREAD_PRIORITY_TIME_CRITICAL : 0)
+# define VLC_THREAD_PRIORITY_AUDIO \
+ (IS_WINNT ? THREAD_PRIORITY_HIGHEST : 0)
# define VLC_THREAD_PRIORITY_VIDEO 0
-# define VLC_THREAD_PRIORITY_OUTPUT THREAD_PRIORITY_ABOVE_NORMAL
+# define VLC_THREAD_PRIORITY_OUTPUT \
+ (IS_WINNT ? THREAD_PRIORITY_ABOVE_NORMAL : 0)
+# define VLC_THREAD_PRIORITY_HIGHEST \
+ (IS_WINNT ? THREAD_PRIORITY_TIME_CRITICAL : 0)
#else
# define VLC_THREAD_PRIORITY_LOW 0
vlc_object_t * p_this;
} vlc_cond_t;
-#elif defined( WIN32 )
+#elif defined( WIN32 ) || defined( UNDER_CE )
typedef HANDLE vlc_thread_t;
typedef BOOL (WINAPI *SIGNALOBJECTANDWAIT) ( HANDLE, HANDLE, DWORD, BOOL );
typedef unsigned (__stdcall *PTHREAD_START) (void *);