From f7c3580478601e3a77dc864e5a1d91c1edad5187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 7 Mar 2018 05:31:03 +0100 Subject: New upstream version 0.9.9 --- lib/glthread/lock.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'lib/glthread/lock.h') diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h index 0628555..ffb2b0e 100644 --- a/lib/glthread/lock.h +++ b/lib/glthread/lock.h @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2017 Free Software Foundation, Inc. + Copyright (C) 2005-2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of either: @@ -158,8 +158,18 @@ extern int glthread_in_use (void); # endif # if !PTHREAD_IN_USE_DETECTION_HARD -# pragma weak pthread_cancel -# define pthread_in_use() (pthread_cancel != NULL) + /* On most platforms, pthread_cancel or pthread_kill can be used to + determine whether libpthread is in use. + On newer versions of FreeBSD, however, this is no longer possible, + because pthread_cancel and pthread_kill got added to libc. Therefore + use pthread_create to test whether libpthread is in use. */ +# if defined __FreeBSD__ || defined __DragonFly__ /* FreeBSD */ +# pragma weak pthread_create +# define pthread_in_use() (pthread_create != NULL) +# else /* glibc, NetBSD, OpenBSD, IRIX, OSF/1, Solaris */ +# pragma weak pthread_cancel +# define pthread_in_use() (pthread_cancel != NULL) +# endif # endif # else -- cgit v1.2.3