aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-11-01 15:23:03 +0200
committerMartin Storsjö <martin@martin.st>2011-11-05 12:09:24 +0200
commit8148631269734f4ecde7a63ca7432e82c12c0b3e (patch)
tree0220829ab490b68ba2685319501b16d511fada28
parentbc8c1395ca343cb15c56055ed7382eeaee1282b4 (diff)
downloadffmpeg-8148631269734f4ecde7a63ca7432e82c12c0b3e.tar.gz
w32threads: Wrap the mutex functions in inline functions returning int
This allows using these wrappers in the gcrypt mutex callbacks. Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavcodec/w32pthreads.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/libavcodec/w32pthreads.h b/libavcodec/w32pthreads.h
index 7774817518..c015b87a42 100644
--- a/libavcodec/w32pthreads.h
+++ b/libavcodec/w32pthreads.h
@@ -91,10 +91,26 @@ static void pthread_join(pthread_t thread, void **value_ptr)
CloseHandle(thread.handle);
}
-#define pthread_mutex_init(m, a) InitializeCriticalSection(m)
-#define pthread_mutex_destroy(m) DeleteCriticalSection(m)
-#define pthread_mutex_lock(m) EnterCriticalSection(m)
-#define pthread_mutex_unlock(m) LeaveCriticalSection(m)
+static inline int pthread_mutex_init(pthread_mutex_t *m, void* attr)
+{
+ InitializeCriticalSection(m);
+ return 0;
+}
+static inline int pthread_mutex_destroy(pthread_mutex_t *m)
+{
+ DeleteCriticalSection(m);
+ return 0;
+}
+static inline int pthread_mutex_lock(pthread_mutex_t *m)
+{
+ EnterCriticalSection(m);
+ return 0;
+}
+static inline int pthread_mutex_unlock(pthread_mutex_t *m)
+{
+ LeaveCriticalSection(m);
+ return 0;
+}
/* for pre-Windows 6.0 platforms we need to define and use our own condition
* variable and api */