]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.3 - patch 20220709
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 9 Jul 2022 22:51:27 +0000 (22:51 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 9 Jul 2022 22:51:27 +0000 (22:51 +0000)
+ lock the prescreen data consistently in newterm, etc., for the
  pthreads configuration (report by Tom de Vries).

16 files changed:
NEWS
VERSION
dist.mk
ncurses/base/lib_newterm.c
ncurses/base/lib_set_term.c
ncurses/base/lib_slkinit.c
ncurses/tinfo/lib_data.c
ncurses/tinfo/lib_setup.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
package/ncursest.spec
test/worm.c

diff --git a/NEWS b/NEWS
index b3d46cbb3385733cc8f8f2bc6bd29fe5e9b2eaf2..e4b391fb92e938350c53967ac8eced7236ec67d8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3826 2022/07/03 22:22:14 tom Exp $
+-- $Id: NEWS,v 1.3828 2022/07/09 22:07:08 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,10 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20220709
+       + lock the prescreen data consistently in newterm, etc., for the
+         pthreads configuration (report by Tom de Vries).
+
 20220703
        + add consistency check in tic for u6/u7/u8/u9 and NQ capabilities.
        + use NQ to flag entries where the terminal does not support query and
diff --git a/VERSION b/VERSION
index 79a301f60f9bc7fa86d9289eb098e76f071e5915..a8abfcce59fb7d46302d33560592959870139047 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.3     20220703
+5:0:10 6.3     20220709
diff --git a/dist.mk b/dist.mk
index 2b2a93f6790f991dbb38ea665e465bba2a6b8ef3..78bec51b8fd767748bc1d1738eaf1242c6ea5362 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -26,7 +26,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1490 2022/07/03 20:03:28 tom Exp $
+# $Id: dist.mk,v 1.1491 2022/07/09 12:55:00 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -38,7 +38,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 3
-NCURSES_PATCH = 20220703
+NCURSES_PATCH = 20220709
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index bba97ba1fae85d301d95c2b1c899a1d00f6d2676..15d05a31b583ea48a40360ef01534d8435ac12f6 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey                                     *
+ * Copyright 2018-2020,2022 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -49,7 +49,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: lib_newterm.c,v 1.103 2020/09/05 21:34:04 tom Exp $")
+MODULE_ID("$Id: lib_newterm.c,v 1.104 2022/07/09 18:58:58 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define NumLabels      InfoOf(SP_PARM).numlabels
@@ -362,11 +362,14 @@ NCURSES_EXPORT(SCREEN *)
 newterm(const char *name, FILE *ofp, FILE *ifp)
 {
     SCREEN *rc;
+
+    _nc_init_pthreads();
     _nc_lock_global(prescreen);
     START_TRACE();
     rc = NCURSES_SP_NAME(newterm) (CURRENT_SCREEN_PRE, name, ofp, ifp);
     _nc_forget_prescr();
     _nc_unlock_global(prescreen);
+
     return rc;
 }
 #endif
index 264fb98ec29d24706ed3b86092d40711823a816f..2d28b7514575fa4b5c18530b84701beeeb2a9762 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey                                *
+ * Copyright 2018-2021,2022 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -54,7 +54,7 @@
 #undef CUR
 #define CUR SP_TERMTYPE
 
-MODULE_ID("$Id: lib_set_term.c,v 1.179 2021/05/08 21:48:34 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.180 2022/07/09 18:58:58 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define MaxColors      InfoOf(sp).maxcolors
@@ -819,10 +819,13 @@ NCURSES_EXPORT(int)
 _nc_ripoffline(int line, int (*init) (WINDOW *, int))
 {
     int rc;
+
+    _nc_init_pthreads();
     _nc_lock_global(prescreen);
     START_TRACE();
     rc = NCURSES_SP_NAME(_nc_ripoffline) (CURRENT_SCREEN_PRE, line, init);
     _nc_unlock_global(prescreen);
+
     return rc;
 }
 #endif
@@ -843,10 +846,13 @@ NCURSES_EXPORT(int)
 ripoffline(int line, int (*init) (WINDOW *, int))
 {
     int rc;
+
+    _nc_init_pthreads();
     _nc_lock_global(prescreen);
     START_TRACE();
     rc = NCURSES_SP_NAME(ripoffline) (CURRENT_SCREEN_PRE, line, init);
     _nc_unlock_global(prescreen);
+
     return rc;
 }
 #endif
index e1602abc9f18855e4f42e20c5248d887bc556169..318077fc96c1cd9fd517a26d292eaf5c3cc2f0b4 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2022 Thomas E. Dickey                                     *
  * Copyright 1998-2009,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -41,7 +41,7 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkinit.c,v 1.15 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_slkinit.c,v 1.16 2022/07/09 18:58:58 tom Exp $")
 
 #ifdef USE_SP_RIPOFF
 #define SoftkeyFormat SP_PARM->slk_format
@@ -77,10 +77,13 @@ NCURSES_EXPORT(int)
 slk_init(int format)
 {
     int rc;
+
+    _nc_init_pthreads();
     _nc_lock_global(prescreen);
     START_TRACE();
     rc = NCURSES_SP_NAME(slk_init) (CURRENT_SCREEN_PRE, format);
     _nc_unlock_global(prescreen);
+
     return rc;
 }
 #endif
index baaa67be36645eb5c905549712b195e61a190eb6..6f6c583a1fc35e583d76b06115d3b2e4488a23ba 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey                                *
+ * Copyright 2018-2021,2022 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -43,7 +43,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_data.c,v 1.86 2021/11/20 23:14:34 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.87 2022/07/09 22:03:21 tom Exp $")
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
@@ -363,25 +363,28 @@ _nc_mutex_init(pthread_mutex_t * obj)
 NCURSES_EXPORT(int)
 _nc_mutex_lock(pthread_mutex_t * obj)
 {
-    if (_nc_use_pthreads == 0)
-       return 0;
-    return pthread_mutex_lock(obj);
+    int rc = 0;
+    if (_nc_use_pthreads != 0)
+       rc = pthread_mutex_lock(obj);
+    return rc;
 }
 
 NCURSES_EXPORT(int)
 _nc_mutex_trylock(pthread_mutex_t * obj)
 {
-    if (_nc_use_pthreads == 0)
-       return 0;
-    return pthread_mutex_trylock(obj);
+    int rc = 0;
+    if (_nc_use_pthreads != 0)
+       rc = pthread_mutex_trylock(obj);
+    return rc;
 }
 
 NCURSES_EXPORT(int)
 _nc_mutex_unlock(pthread_mutex_t * obj)
 {
-    if (_nc_use_pthreads == 0)
-       return 0;
-    return pthread_mutex_unlock(obj);
+    int rc = 0;
+    if (_nc_use_pthreads != 0)
+       rc = pthread_mutex_unlock(obj);
+    return rc;
 }
 #endif /* USE_PTHREADS */
 
index 434d5633a7dcb8388e8eceb43b82c1b233c0d4b0..5ed47409bb0abb39fa29fa8255af77c238f93143 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey                                *
+ * Copyright 2018-2021,2022 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -49,7 +49,7 @@
 #include <locale.h>
 #endif
 
-MODULE_ID("$Id: lib_setup.c,v 1.215 2021/11/20 23:11:31 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.216 2022/07/09 18:58:58 tom Exp $")
 
 /****************************************************************************
  *
@@ -990,6 +990,7 @@ _nc_setupterm(const char *tname,
     int rc = ERR;
     TERMINAL *termp = 0;
 
+    _nc_init_pthreads();
     _nc_lock_global(prescreen);
     START_TRACE();
     if (TINFO_SETUP_TERM(&termp, tname, Filedes, errret, reuse) == OK) {
@@ -999,6 +1000,7 @@ _nc_setupterm(const char *tname,
        }
     }
     _nc_unlock_global(prescreen);
+
     return rc;
 }
 #endif
index c9b079e61e064b9ca35c187ded4ebba34ff1cc9d..e7d1eabd355c5a1cd1cf0a3d0ea91b03ab9872bc 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220703) unstable; urgency=low
+ncurses6 (6.3+20220709) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 03 Jul 2022 16:03:28 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 09 Jul 2022 08:55:00 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index c9b079e61e064b9ca35c187ded4ebba34ff1cc9d..e7d1eabd355c5a1cd1cf0a3d0ea91b03ab9872bc 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220703) unstable; urgency=low
+ncurses6 (6.3+20220709) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 03 Jul 2022 16:03:28 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 09 Jul 2022 08:55:00 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index d42c94da4f6cb4e1aafb8759d263a8e8deb42a5e..2cd4ba6021a32e38bfe5b540b5a2169c0d2558de 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220703) unstable; urgency=low
+ncurses6 (6.3+20220709) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 03 Jul 2022 16:03:28 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 09 Jul 2022 08:55:00 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 7c9faa0b0ba2be64974017d9386a9aacf9900e9e..3515f090af929ddef9015fdf0b680c323f80bbe0 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.530 2022/07/03 20:03:28 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.531 2022/07/09 12:55:00 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "3"\r
 !define VERSION_YYYY  "2022"\r
-!define VERSION_MMDD  "0703"\r
+!define VERSION_MMDD  "0709"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index cfe4807f3fc3f2f9036901ba74a754fb3482d829..1b449e8268530eed5c5f749af89b51d42e584f5b 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.3
-Release: 20220703
+Release: 20220709
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 76ded985d0bba98681c39f2425afde2d689d5c94..ad7da53b2ad5736938f34acf44cb7c5d81987a3c 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.3
-Release: 20220703
+Release: 20220709
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index e81ce017c94ba98381526682f16c1ebdc1b2cc91..efc86cc9323f9c6b0dc5721bf24fd243967f9f30 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.3
-Release: 20220703
+Release: 20220709
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 6304e4b06a88e750d006bc68a6c52276de1fb968..ab1eb9faf66b0ee5218adb0d7dad948ac0be545c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2022 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -53,7 +53,7 @@
   traces will be dumped.  The program stops and waits for one character of
   input at the beginning and end of the interval.
 
-  $Id: worm.c,v 1.82 2020/02/02 23:34:34 tom Exp $
+  $Id: worm.c,v 1.83 2022/07/09 20:51:25 tom Exp $
 */
 
 #include <test.priv.h>
@@ -350,11 +350,7 @@ start_worm(void *arg)
     while (!quit_worm((int) (((struct worm *) arg) - worm))) {
        while (compare < sequence) {
            ++compare;
-#if HAVE_USE_WINDOW
-           use_window(stdscr, draw_worm, arg);
-#else
-           draw_worm(stdscr, arg);
-#endif
+           USING_WINDOW2(stdscr, draw_worm, arg);
        }
     }
     Trace(("...start_worm (done)"));
@@ -379,13 +375,7 @@ draw_all_worms(void)
     }
 #else
     for (n = 0, w = &worm[0]; n < number; n++, w++) {
-       if (
-#if HAVE_USE_WINDOW
-              USING_WINDOW2(stdscr, draw_worm, w)
-#else
-              draw_worm(stdscr, w)
-#endif
-           )
+       if (USING_WINDOW2(stdscr, draw_worm, w))
            done = TRUE;
     }
 #endif