From a17be5576fae918c683688a0e2bd2fd21b32d428 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 31 Jan 2014 19:50:25 +0100 Subject: threads: add wrapper for initializing recursive mutexes Damn this overly verbose pthread API. --- sub/dec_sub.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sub') diff --git a/sub/dec_sub.c b/sub/dec_sub.c index 64d285f568..46c5b3fafb 100644 --- a/sub/dec_sub.c +++ b/sub/dec_sub.c @@ -31,6 +31,7 @@ #include "common/global.h" #include "common/msg.h" #include "misc/charset_conv.h" +#include "osdep/threads.h" extern const struct sd_functions sd_ass; extern const struct sd_functions sd_lavc; @@ -96,11 +97,7 @@ struct dec_sub *sub_create(struct mpv_global *global) sub->log = mp_log_new(sub, global->log, "sub"); sub->opts = global->opts; - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&sub->lock, &attr); - pthread_mutexattr_destroy(&attr); + mpthread_mutex_init_recursive(&sub->lock); return sub; } -- cgit v1.2.3