mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-17 20:40:07 +01:00
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>
This commit is contained in:
@@ -91,10 +91,26 @@ static void pthread_join(pthread_t thread, void **value_ptr)
|
|||||||
CloseHandle(thread.handle);
|
CloseHandle(thread.handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define pthread_mutex_init(m, a) InitializeCriticalSection(m)
|
static inline int pthread_mutex_init(pthread_mutex_t *m, void* attr)
|
||||||
#define pthread_mutex_destroy(m) DeleteCriticalSection(m)
|
{
|
||||||
#define pthread_mutex_lock(m) EnterCriticalSection(m)
|
InitializeCriticalSection(m);
|
||||||
#define pthread_mutex_unlock(m) LeaveCriticalSection(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
|
/* for pre-Windows 6.0 platforms we need to define and use our own condition
|
||||||
* variable and api */
|
* variable and api */
|
||||||
|
|||||||
Reference in New Issue
Block a user