mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-24 02:09:03 +03:00
compat/os2threads.h: add pthread_mutex_trylock
This commit is contained in:
committed by
James Almer
parent
1f26f9d9e1
commit
e1e325235e
@@ -123,6 +123,12 @@ static av_always_inline int pthread_mutex_lock(pthread_mutex_t *mutex)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_mutex_trylock(pthread_mutex_t *mutex)
|
||||
{
|
||||
return _fmutex_request(mutex, _FMR_NOWAIT) == ERROR_MUTEX_OWNED ?
|
||||
EBUSY : 0;
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_mutex_unlock(pthread_mutex_t *mutex)
|
||||
{
|
||||
_fmutex_release(mutex);
|
||||
|
||||
Reference in New Issue
Block a user