From 58a9610acfc264cd93def625157774a8dc0e79ed Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 21 Aug 2014 22:15:32 +0200 Subject: terminal-win: read input from a thread Surprisingly, WaitFor* works on console handles. We can simply run the code for reading the console in a thread, and don't have to worry about crazy win32 crap in the rest of the player's input code anymore. This also fixes the issue that you couldn't unpause the player from the terminal, because the player would stop polling for input. --- osdep/terminal-unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'osdep/terminal-unix.c') diff --git a/osdep/terminal-unix.c b/osdep/terminal-unix.c index 3a0117389c..2bac169f36 100644 --- a/osdep/terminal-unix.c +++ b/osdep/terminal-unix.c @@ -29,6 +29,7 @@ #include #include #include +#include #if HAVE_TERMIOS #if HAVE_TERMIOS_H @@ -557,8 +558,7 @@ static void quit_request_sighandler(int signum) static void getch2_enable(void) { - if (getch2_enabled) - return; + assert(!getch2_enabled); // handlers to fix terminal settings setsigaction(SIGCONT, continue_sighandler, 0, true); -- cgit v1.2.3