From 174df99ffa53f1091589eaa4fa0c16cdd55a9326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sat, 21 Oct 2023 04:55:41 +0200 Subject: ALL: use new mp_thread abstraction --- player/scripting.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'player/scripting.c') diff --git a/player/scripting.c b/player/scripting.c index b7268f9b91..962a5e815f 100644 --- a/player/scripting.c +++ b/player/scripting.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -87,7 +86,7 @@ static void run_script(struct mp_script_args *arg) { char *name = talloc_asprintf(NULL, "%s/%s", arg->backend->name, mpv_client_name(arg->client)); - mpthread_set_name(name); + mp_thread_set_name(name); talloc_free(name); if (arg->backend->load(arg) < 0) @@ -97,14 +96,14 @@ static void run_script(struct mp_script_args *arg) talloc_free(arg); } -static void *script_thread(void *p) +static MP_THREAD_VOID script_thread(void *p) { - pthread_detach(pthread_self()); + pthread_detach(mp_thread_self()); struct mp_script_args *arg = p; run_script(arg); - return NULL; + MP_THREAD_RETURN(); } static int64_t mp_load_script(struct MPContext *mpctx, const char *fname) @@ -193,8 +192,8 @@ static int64_t mp_load_script(struct MPContext *mpctx, const char *fname) if (backend->no_thread) { run_script(arg); } else { - pthread_t thread; - if (pthread_create(&thread, NULL, script_thread, arg)) { + mp_thread thread; + if (mp_thread_create(&thread, script_thread, arg)) { mpv_destroy(arg->client); talloc_free(arg); return -1; -- cgit v1.2.3