aboutsummaryrefslogtreecommitdiffhomepage
path: root/osdep/terminal-unix.c
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2014-08-21 22:15:32 +0200
committerGravatar wm4 <wm4@nowhere>2014-08-21 22:45:58 +0200
commit58a9610acfc264cd93def625157774a8dc0e79ed (patch)
tree604ef9999e2dd378038775457b4dcae09d60a63e /osdep/terminal-unix.c
parent5890e59dbc90e6ed1ae9ccec173006655895918e (diff)
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.
Diffstat (limited to 'osdep/terminal-unix.c')
-rw-r--r--osdep/terminal-unix.c4
1 files changed, 2 insertions, 2 deletions
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 <signal.h>
#include <errno.h>
#include <sys/ioctl.h>
+#include <assert.h>
#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);