diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-11-06 04:55:36 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-11-06 04:14:49 +0000 |
commit | a7186777de9ac6f4970f167204aa966752cee0db (patch) | |
tree | 6ad2ba6fa972f1c6301f76fbcd41f5f7bbbc8c01 /osdep | |
parent | 84de84b8aa6023efb3f8fac368d802359657268c (diff) | |
download | mpv-a7186777de9ac6f4970f167204aa966752cee0db.tar.bz2 mpv-a7186777de9ac6f4970f167204aa966752cee0db.tar.xz |
threads: unbreak mpv on builds without asserts
Also remove duplicated macro.
Fixes: #12818 #12820
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/threads-posix.h | 1 | ||||
-rw-r--r-- | osdep/threads-win32.h | 3 | ||||
-rw-r--r-- | osdep/threads.h | 2 |
3 files changed, 2 insertions, 4 deletions
diff --git a/osdep/threads-posix.h b/osdep/threads-posix.h index 02388a5acf..ea1d86fdb5 100644 --- a/osdep/threads-posix.h +++ b/osdep/threads-posix.h @@ -122,6 +122,7 @@ static inline int mp_mutex_init_type_internal(mp_mutex *mutex, enum mp_mutex_typ pthread_mutexattr_settype(&attr, mutex_type); ret = pthread_mutex_init(mutex, &attr); pthread_mutexattr_destroy(&attr); + assert(!ret); return ret; } diff --git a/osdep/threads-win32.h b/osdep/threads-win32.h index ef661aa53a..2617bcb51b 100644 --- a/osdep/threads-win32.h +++ b/osdep/threads-win32.h @@ -51,9 +51,6 @@ static inline int mp_mutex_init_type_internal(mp_mutex *mutex, enum mp_mutex_typ return 0; } -#define mp_mutex_init_type(mutex, mtype) \ - assert(!mp_mutex_init_type_internal(mutex, mtype)) - static inline int mp_mutex_destroy(mp_mutex *mutex) { if (mutex->use_cs) diff --git a/osdep/threads.h b/osdep/threads.h index a3d1b3a569..b6d950e5de 100644 --- a/osdep/threads.h +++ b/osdep/threads.h @@ -12,7 +12,7 @@ enum mp_mutex_type { mp_mutex_init_type(mutex, MP_MUTEX_NORMAL) #define mp_mutex_init_type(mutex, mtype) \ - assert(!mp_mutex_init_type_internal(mutex, mtype)) + mp_mutex_init_type_internal(mutex, mtype) #if HAVE_WIN32_THREADS #include "threads-win32.h" |