]> git.sesse.net Git - vlc/blobdiff - include/vlc_threads.h
move mutex setkind hack to src/
[vlc] / include / vlc_threads.h
index 911d36b73709dd3c895bfef4a352f6581291395c..43c3cd9fea670b773089d3d7cdb09056d2d9e578 100644 (file)
 
 #include <stdio.h>
 
-#if defined(DEBUG) && defined(HAVE_SYS_TIME_H)
-#   include <sys/time.h>
-#endif
-
-#if defined( PTH_INIT_IN_PTH_H )                                  /* GNU Pth */
-#   include <pth.h>
-
-#elif defined( ST_INIT_IN_ST_H )                            /* State threads */
-#   include <st.h>
-
-#elif defined( UNDER_CE )
+#if defined( UNDER_CE )
                                                                 /* WinCE API */
 #elif defined( WIN32 )
 #   include <process.h>                                         /* Win32 API */
 #   define LIBVLC_USE_PTHREAD 1
 #   define _APPLE_C_SOURCE    1 /* Proper pthread semantics on OSX */
 
+#   include <unistd.h> /* _POSIX_SPIN_LOCKS */
 #   include <pthread.h>
+    /* Needed for pthread_cond_timedwait */
+#   include <errno.h>
 #   ifdef DEBUG
-        /* Needed for pthread_cond_timedwait */
-#       include <errno.h>
+#      include <time.h>
 #   endif
-    /* 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 !
  * Type definitions
  *****************************************************************************/
 
-#if defined( PTH_INIT_IN_PTH_H )
-typedef pth_t            vlc_thread_t;
-typedef struct
-{
-    pth_mutex_t mutex;
-    vlc_object_t * p_this;
-} vlc_mutex_t;
-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;
-typedef struct
-{
-    st_mutex_t mutex;
-    vlc_object_t * p_this;
-} vlc_mutex_t;
-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 )
+#if defined( WIN32 ) || defined( UNDER_CE )
 typedef struct
 {
     /* thread id */
@@ -254,37 +207,6 @@ typedef struct
     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 */