]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/lib_tstp.c
ncurses 6.3 - patch 20220813
[ncurses.git] / ncurses / tty / lib_tstp.c
index a20e72a9d96b159e82356af7845bb23744b5aa35..ec086ca730c8dce69ec4b845d6f62ef0d0cf2cb4 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020,2021 Thomas E. Dickey                                     *
+ * Copyright 2020-2021,2022 Thomas E. Dickey                                *
  * Copyright 1998-2014,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -43,7 +43,7 @@
 
 #include <SigAction.h>
 
-MODULE_ID("$Id: lib_tstp.c,v 1.51 2021/09/04 10:54:35 tom Exp $")
+MODULE_ID("$Id: lib_tstp.c,v 1.52 2022/08/13 14:36:43 tom Exp $")
 
 #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC)
 #define USE_SIGTSTP 1
@@ -284,6 +284,22 @@ handle_SIGINT(int sig)
 }
 
 #if USE_SIGWINCH
+
+# ifndef _nc_set_read_thread
+NCURSES_EXPORT(void)
+_nc_set_read_thread(bool enable)
+{
+    if (enable) {
+#  if USE_WEAK_SYMBOLS
+       if ((pthread_self) && (pthread_kill) && (pthread_equal))
+#  endif
+           _nc_globals.read_thread = pthread_self();
+    } else {
+       _nc_globals.read_thread = 0;
+    }
+}
+# endif
+
 static void
 handle_SIGWINCH(int sig GCC_UNUSED)
 {