compat/os2threads.h: add pthread_mutex_trylock

This commit is contained in:
KO Myung-Hun authored and James Almer committed 2026-08-19 16:20:15 +00:00
1 parent 1f26f9d9e1
commit e1e325235e
1 file changed
+6
+6
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);