From 44a3eaeba04ef78835ca741592c376428ada5f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 2 Dec 2017 10:30:25 +0100 Subject: New upstream version 0.9.8 --- tests/glthread/thread.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'tests/glthread/thread.h') diff --git a/tests/glthread/thread.h b/tests/glthread/thread.h index 4488a9e..b64e267 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 . */ + along with this program; if not, see . */ /* Written by Bruno Haible , 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 - + */ @@ -128,7 +128,9 @@ extern int glthread_in_use (void); /* Without this, clang complains that pthread_sigmask is never declared. */ # include # 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 -- cgit v1.2.3