mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 10:04:37 +08:00
compat/os2threads.h: add pthread_mutex_trylock
This commit is contained in:
1 parent
1f26f9d9e1
commit
e1e325235e
1 file changed
+6
@@ -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