diff options
| author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-12-02 12:05:34 +0100 | 
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-12-02 12:05:34 +0100 | 
| commit | 7c78c92a28ef43d68b172adf97fbd8a27be3baec (patch) | |
| tree | 3a98b0d01865f5e00912521c58386eb008a70d07 /tests/glthread | |
| parent | 4d76768442551c97a85e6f133cb818d223012746 (diff) | |
| parent | 3ee36dc9787cee6ab5314af8f9c01b05a50e7d9d (diff) | |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'tests/glthread')
| -rw-r--r-- | tests/glthread/thread.c | 4 | ||||
| -rw-r--r-- | tests/glthread/thread.h | 21 | ||||
| -rw-r--r-- | tests/glthread/yield.h | 4 | 
3 files changed, 16 insertions, 13 deletions
| 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); | 
