From 44a3eaeba04ef78835ca741592c376428ada5f71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= <debian@jff-webhosting.net>
Date: Sat, 2 Dec 2017 10:30:25 +0100
Subject: New upstream version 0.9.8

---
 tests/glthread/thread.c |  4 ++--
 tests/glthread/thread.h | 21 ++++++++++++---------
 tests/glthread/yield.h  |  4 ++--
 3 files changed, 16 insertions(+), 13 deletions(-)

(limited to 'tests/glthread')

diff --git a/tests/glthread/thread.c b/tests/glthread/thread.c
index 8f2a8e25..8d7d2519 100644
--- a/tests/glthread/thread.c
+++ b/tests/glthread/thread.c
@@ -1,5 +1,5 @@
 /* Creating and controlling threads.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.
    Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
diff --git a/tests/glthread/thread.h b/tests/glthread/thread.h
index 4488a9ee..b64e267f 100644
--- a/tests/glthread/thread.h
+++ b/tests/glthread/thread.h
@@ -1,5 +1,5 @@
 /* Creating and controlling threads.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.
    Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
@@ -64,7 +64,7 @@
                                    void (*child_func) (void));
    Note that even on platforms where this is supported, use of fork() and
    threads together is problematic, see
-     <http://lists.gnu.org/archive/html/bug-gnulib/2008-08/msg00062.html>
+     <https://lists.gnu.org/r/bug-gnulib/2008-08/msg00062.html>
  */
 
 
@@ -128,7 +128,9 @@ extern int glthread_in_use (void);
   /* Without this, clang complains that pthread_sigmask is never declared.  */
 #   include <signal.h>
 #  endif
-#  pragma weak pthread_sigmask
+#  ifndef pthread_sigmask /* Do not declare rpl_pthread_sigmask weak.  */
+#   pragma weak pthread_sigmask
+#  endif
 
 #  pragma weak pthread_join
 #  ifndef pthread_self
@@ -219,6 +221,7 @@ extern "C" {
 
 /* Use weak references to the GNU Pth threads library.  */
 
+#  pragma weak pth_init
 #  pragma weak pth_spawn
 #  pragma weak pth_sigmask
 #  pragma weak pth_join
@@ -237,17 +240,17 @@ extern "C" {
 
 typedef pth_t gl_thread_t;
 # define glthread_create(THREADP, FUNC, ARG) \
-    (pth_in_use () ? ((*(THREADP) = pth_spawn (NULL, FUNC, ARG)) ? 0 : errno) : 0)
+    (pth_in_use () ? (pth_init (), ((*(THREADP) = pth_spawn (NULL, FUNC, ARG)) ? 0 : errno)) : 0)
 # define glthread_sigmask(HOW, SET, OSET) \
-    (pth_in_use () && !pth_sigmask (HOW, SET, OSET) ? errno : 0)
+    (pth_in_use () ? (pth_init (), (pth_sigmask (HOW, SET, OSET) ? 0 : errno)) : 0)
 # define glthread_join(THREAD, RETVALP) \
-    (pth_in_use () && !pth_join (THREAD, RETVALP) ? errno : 0)
+    (pth_in_use () ? (pth_init (), (pth_join (THREAD, RETVALP) ? 0 : errno)) : 0)
 # define gl_thread_self() \
-    (pth_in_use () ? (void *) pth_self () : NULL)
+    (pth_in_use () ? (pth_init (), (void *) pth_self ()) : NULL)
 # define gl_thread_self_pointer() \
     gl_thread_self ()
 # define gl_thread_exit(RETVAL) \
-    (pth_in_use () ? pth_exit (RETVAL) : 0)
+    (pth_in_use () ? (pth_init (), pth_exit (RETVAL)) : 0)
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
 
 # ifdef __cplusplus
diff --git a/tests/glthread/yield.h b/tests/glthread/yield.h
index 19224c63..b5718284 100644
--- a/tests/glthread/yield.h
+++ b/tests/glthread/yield.h
@@ -1,5 +1,5 @@
 /* Yielding the processor to other threads and processes.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* This file contains a primitive for yielding the processor to other threads.
      extern void gl_thread_yield (void);
-- 
cgit v1.2.3