diff options
Diffstat (limited to 'osdep/terminal-unix.c')
-rw-r--r-- | osdep/terminal-unix.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/osdep/terminal-unix.c b/osdep/terminal-unix.c index 43a74e6bdb..d5b8fe36b1 100644 --- a/osdep/terminal-unix.c +++ b/osdep/terminal-unix.c @@ -23,7 +23,6 @@ #include <signal.h> #include <errno.h> #include <sys/ioctl.h> -#include <pthread.h> #include <assert.h> #include <termios.h> @@ -349,7 +348,7 @@ static void getch2_poll(void) do_deactivate_getch2(); } -static pthread_t input_thread; +static mp_thread input_thread; static struct input_ctx *input_ctx; static int death_pipe[2] = {-1, -1}; enum { PIPE_STOP, PIPE_CONT }; @@ -406,9 +405,9 @@ static void quit_request_sighandler(int signum) errno = saved_errno; } -static void *terminal_thread(void *ptr) +static MP_THREAD_VOID terminal_thread(void *ptr) { - mpthread_set_name("terminal/input"); + mp_thread_set_name("terminal/input"); bool stdin_ok = read_terminal; // if false, we still wait for SIGTERM while (1) { getch2_poll(); @@ -461,7 +460,7 @@ static void *terminal_thread(void *ptr) if (cmd) mp_input_queue_cmd(input_ctx, cmd); } - return NULL; + MP_THREAD_RETURN(); } void terminal_setup_getch(struct input_ctx *ictx) @@ -483,7 +482,7 @@ void terminal_setup_getch(struct input_ctx *ictx) input_ctx = ictx; - if (pthread_create(&input_thread, NULL, terminal_thread, NULL)) { + if (mp_thread_create(&input_thread, terminal_thread, NULL)) { input_ctx = NULL; close_sig_pipes(); close_tty(); @@ -511,7 +510,7 @@ void terminal_uninit(void) if (input_ctx) { (void)write(death_pipe[1], &(char){0}, 1); - pthread_join(input_thread, NULL); + mp_thread_join(input_thread); close_sig_pipes(); input_ctx = NULL; } |