about summary refs log tree commit diff stats
path: root/src/ui/inputwin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/inputwin.c')
-rw-r--r--src/ui/inputwin.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c
index fc1c204d..c94c0a8c 100644
--- a/src/ui/inputwin.c
+++ b/src/ui/inputwin.c
@@ -42,6 +42,7 @@
 #include <wchar.h>
 #include <sys/time.h>
 #include <errno.h>
+#include <pthread.h>
 
 #include <readline/readline.h>
 #include <readline/history.h>
@@ -145,7 +146,9 @@ inp_readline(void)
     FD_ZERO(&fds);
     FD_SET(fileno(rl_instream), &fds);
     errno = 0;
+    pthread_mutex_unlock(&lock);
     r = select(FD_SETSIZE, &fds, NULL, NULL, &p_rl_timeout);
+    pthread_mutex_lock(&lock);
     if (r < 0) {
         if (errno != EINTR) {
             char *err_msg = strerror(errno);