]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/lib_tstp.c
ncurses 6.4 - patch 20230917
[ncurses.git] / ncurses / tty / lib_tstp.c
index ec086ca730c8dce69ec4b845d6f62ef0d0cf2cb4..dd925c7efd12b16045644b4e324bedb97798496b 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <SigAction.h>
 
-MODULE_ID("$Id: lib_tstp.c,v 1.52 2022/08/13 14:36:43 tom Exp $")
+MODULE_ID("$Id: lib_tstp.c,v 1.54 2022/12/24 22:22:10 tom Exp $")
 
 #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC)
 #define USE_SIGTSTP 1
@@ -283,12 +283,11 @@ handle_SIGINT(int sig)
     _exit(EXIT_FAILURE);
 }
 
-#if USE_SIGWINCH
-
 # ifndef _nc_set_read_thread
 NCURSES_EXPORT(void)
 _nc_set_read_thread(bool enable)
 {
+    _nc_lock_global(curses);
     if (enable) {
 #  if USE_WEAK_SYMBOLS
        if ((pthread_self) && (pthread_kill) && (pthread_equal))
@@ -297,9 +296,12 @@ _nc_set_read_thread(bool enable)
     } else {
        _nc_globals.read_thread = 0;
     }
+    _nc_unlock_global(curses);
 }
 # endif
 
+#if USE_SIGWINCH
+
 static void
 handle_SIGWINCH(int sig GCC_UNUSED)
 {