From e1e325235ee2f9f81b39d47ac2f9fe529257589e Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Tue, 18 Aug 2026 22:57:20 +0900 Subject: [PATCH] compat/os2threads.h: add pthread_mutex_trylock --- compat/os2threads.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compat/os2threads.h b/compat/os2threads.h index a061eaa63d..7a8e391f65 100644 --- a/compat/os2threads.h +++ b/compat/os2threads.h @@ -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);