PR #24202 opened by KO Myung-Hun (komh) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24202 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24202.patch
Hi/2. This PR improves os2threads. 1. Enable os2threads with atomic support 2. Add pthread_mutex_trylock() Review, please... >From 2f0a4e24f10df7c277ace2c23c13aa8db2f0132a Mon Sep 17 00:00:00 2001 From: KO Myung-Hun <[email protected]> Date: Mon, 27 Jul 2026 23:40:38 +0900 Subject: [PATCH 1/2] configure: enable os2threads with atomics support --- configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure b/configure index f2896b81c7..fb0f92f988 100755 --- a/configure +++ b/configure @@ -2267,6 +2267,7 @@ THREADS_LIST=" ATOMICS_LIST=" atomics_win32 + atomics_os2 " AUTODETECT_LIBS=" @@ -3036,8 +3037,10 @@ valgrind_backtrace_deps="valgrind_valgrind_h" # threading support atomics_win32_if="MemoryBarrier" +atomics_os2_if="stdatomic" atomics_native_if_any="$ATOMICS_LIST" w32threads_deps="atomics_native" +os2threads_deps="atomics_native" threads_if_any="$THREADS_LIST" # subsystems -- 2.52.0 >From 44c9fc05ca792d044adffef6946695d8fd6fa129 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun <[email protected]> Date: Tue, 18 Aug 2026 22:57:20 +0900 Subject: [PATCH 2/2] 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); -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
