]> git.sesse.net Git - vlc/blobdiff - include/vlc_threads.h
qt4: fix the use of HTTP in open dialog
[vlc] / include / vlc_threads.h
index 67ef7619d80b35d50f9375490c76d562eba30417..31b851c62b9adc180e6406f62b7fd21371487a81 100644 (file)
@@ -29,6 +29,9 @@
   #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 <stdio.h>
 
 #if defined(DEBUG) && defined(HAVE_SYS_TIME_H)
 
 #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 <pthread.h>
-#   ifdef DEBUG
-        /* Needed for pthread_cond_timedwait */
-#       include <errno.h>
-#   endif
+    /* Needed for pthread_cond_timedwait */
+#   include <errno.h>
     /* This is not prototyped under Linux, though it exists. */
     int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
 
@@ -141,6 +143,7 @@ typedef struct
 } vlc_cond_t;
 typedef struct
 {
+    int handle;
 } vlc_threadvar_t;
 
 #elif defined( ST_INIT_IN_ST_H )
@@ -157,12 +160,22 @@ typedef struct
 } vlc_cond_t;
 typedef struct
 {
+    int handle;
 } vlc_threadvar_t;
 
 #elif defined( WIN32 ) || defined( UNDER_CE )
-typedef HANDLE vlc_thread_t;
+typedef struct
+{
+    /* thread id */
+    DWORD  id;
+    /*
+    ** handle to created thread, needs be closed to dispose of it
+    ** even after thread has exited
+    */
+    HANDLE hThread;
+} vlc_thread_t;
+
 typedef BOOL (WINAPI *SIGNALOBJECTANDWAIT) ( HANDLE, HANDLE, DWORD, BOOL );
-typedef unsigned (WINAPI *PTHREAD_START) (void *);
 
 typedef struct
 {
@@ -196,7 +209,7 @@ typedef struct
 #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;
 
@@ -272,3 +285,4 @@ typedef struct
 
 #endif
 
+#endif