]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/w32pthreads.h
ppc: More consistent names for H.264 optimizations files
[ffmpeg] / libavcodec / w32pthreads.h
index 70b84cf2e17e6482a000ce24a586a5aa028b93d8..91e7353fbb820b86f89d6b988edbd0b04ee5f664 100644 (file)
 #include <windows.h>
 #include <process.h>
 
-typedef struct {
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
+
+typedef struct pthread_t {
     void *handle;
     void *(*func)(void* arg);
     void *arg;
@@ -53,7 +56,7 @@ typedef CRITICAL_SECTION pthread_mutex_t;
 /* This is the CONDITIONAL_VARIABLE typedef for using Window's native
  * conditional variables on kernels 6.0+.
  * MinGW does not currently have this typedef. */
-typedef struct {
+typedef struct pthread_cond_t {
     void *ptr;
 } pthread_cond_t;
 
@@ -114,7 +117,7 @@ static inline int pthread_mutex_unlock(pthread_mutex_t *m)
 
 /* for pre-Windows 6.0 platforms we need to define and use our own condition
  * variable and api */
-typedef struct {
+typedef struct  win32_cond_t {
     pthread_mutex_t mtx_broadcast;
     pthread_mutex_t mtx_waiter_count;
     volatile int waiter_count;
@@ -194,13 +197,13 @@ static void pthread_cond_broadcast(pthread_cond_t *cond)
     pthread_mutex_unlock(&win32_cond->mtx_broadcast);
 }
 
-static void pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
+static int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
 {
     win32_cond_t *win32_cond = cond->ptr;
     int last_waiter;
     if (cond_wait) {
         cond_wait(cond, mutex, INFINITE);
-        return;
+        return 0;
     }
 
     /* non native condition variables */