summaryrefslogtreecommitdiff
path: root/lib/glthread
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-03-07 05:54:53 +0100
committerJörg Frings-Fürst <debian@jff.email>2018-03-07 05:54:53 +0100
commit76ef1d8e3249e82a6965fd17157bee00a7857ff3 (patch)
tree7d3d34b059039faf525d1e95bbdc1945a9fa103c /lib/glthread
parent0cb66c451a1a4e717878b8296b79c8d7cfd38b30 (diff)
parent93e8e16be294d19261c7378dd2e46d3f35f06926 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'lib/glthread')
-rw-r--r--lib/glthread/lock.c2
-rw-r--r--lib/glthread/lock.h16
-rw-r--r--lib/glthread/threadlib.c2
3 files changed, 15 insertions, 5 deletions
diff --git a/lib/glthread/lock.c b/lib/glthread/lock.c
index df05dbc0..9e148910 100644
--- a/lib/glthread/lock.c
+++ b/lib/glthread/lock.c
@@ -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:
diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h
index 06285558..ffb2b0e5 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
diff --git a/lib/glthread/threadlib.c b/lib/glthread/threadlib.c
index 82b8861b..3534b61e 100644
--- a/lib/glthread/threadlib.c
+++ b/lib/glthread/threadlib.c
@@ -1,5 +1,5 @@
/* Multithreading primitives.
- 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: