summaryrefslogtreecommitdiffstats
path: root/input/input.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-31 19:50:25 +0100
committerwm4 <wm4@nowhere>2014-01-31 19:50:25 +0100
commita17be5576fae918c683688a0e2bd2fd21b32d428 (patch)
treec46ceb404511ce0fbceadae24e85420bb7667321 /input/input.c
parent2305ffcaba2b762825cc18cb35cec06c203e3821 (diff)
downloadmpv-a17be5576fae918c683688a0e2bd2fd21b32d428.tar.bz2
mpv-a17be5576fae918c683688a0e2bd2fd21b32d428.tar.xz
threads: add wrapper for initializing recursive mutexes
Damn this overly verbose pthread API.
Diffstat (limited to 'input/input.c')
-rw-r--r--input/input.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/input/input.c b/input/input.c
index 42b45b842f..d4905112dc 100644
--- a/input/input.c
+++ b/input/input.c
@@ -41,6 +41,7 @@
#include "keycodes.h"
#include "cmd_list.h"
#include "cmd_parse.h"
+#include "osdep/threads.h"
#include "osdep/timer.h"
#include "common/msg.h"
#include "common/global.h"
@@ -1474,11 +1475,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global)
.wakeup_pipe = {-1, -1},
};
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&ictx->mutex, &attr);
- pthread_mutexattr_destroy(&attr);
+ mpthread_mutex_init_recursive(&ictx->mutex);
// Setup default section, so that it does nothing.
mp_input_enable_section(ictx, NULL, MP_INPUT_ALLOW_VO_DRAGGING |