Skip to content

Commit

Permalink
threads: unbreak mpv on builds without asserts
Browse files Browse the repository at this point in the history
Also remove duplicated macro.

Fixes: mpv-player#12818 mpv-player#12820
  • Loading branch information
kasper93 authored and Dudemanguy committed Nov 6, 2023
1 parent 84de84b commit a718677
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions osdep/threads-posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 0 additions & 3 deletions osdep/threads-win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion osdep/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a718677

Please sign in to comment.