1
0
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:
KO Myung-Hun
2026-08-18 22:57:20 +09:00
committed by James Almer
parent 1f26f9d9e1
commit e1e325235e

View File

@@ -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);