summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bind/lib/isc/pthreads
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bind/lib/isc/pthreads')
-rw-r--r--usr.sbin/bind/lib/isc/pthreads/Makefile.in5
-rw-r--r--usr.sbin/bind/lib/isc/pthreads/condition.c5
-rw-r--r--usr.sbin/bind/lib/isc/pthreads/include/Makefile.in5
-rw-r--r--usr.sbin/bind/lib/isc/pthreads/include/isc/Makefile.in5
-rw-r--r--usr.sbin/bind/lib/isc/pthreads/include/isc/condition.h5
-rw-r--r--usr.sbin/bind/lib/isc/pthreads/include/isc/mutex.h7
-rw-r--r--usr.sbin/bind/lib/isc/pthreads/include/isc/once.h5
-rw-r--r--usr.sbin/bind/lib/isc/pthreads/include/isc/thread.h12
-rw-r--r--usr.sbin/bind/lib/isc/pthreads/mutex.c5
-rw-r--r--usr.sbin/bind/lib/isc/pthreads/thread.c24
10 files changed, 47 insertions, 31 deletions
diff --git a/usr.sbin/bind/lib/isc/pthreads/Makefile.in b/usr.sbin/bind/lib/isc/pthreads/Makefile.in
index 2bc09059525..3fd5fa63283 100644
--- a/usr.sbin/bind/lib/isc/pthreads/Makefile.in
+++ b/usr.sbin/bind/lib/isc/pthreads/Makefile.in
@@ -1,5 +1,4 @@
-# Copyright (C) 2004, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 1998-2001 Internet Software Consortium.
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -13,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2019/12/16 16:16:27 deraadt Exp $
+# $Id: Makefile.in,v 1.3 2019/12/17 01:46:36 sthen Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/usr.sbin/bind/lib/isc/pthreads/condition.c b/usr.sbin/bind/lib/isc/pthreads/condition.c
index 8114aaf475f..fea79415fc7 100644
--- a/usr.sbin/bind/lib/isc/pthreads/condition.c
+++ b/usr.sbin/bind/lib/isc/pthreads/condition.c
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: condition.c,v 1.2 2019/12/16 16:16:27 deraadt Exp $ */
+/* $Id: condition.c,v 1.3 2019/12/17 01:46:36 sthen Exp $ */
/*! \file */
diff --git a/usr.sbin/bind/lib/isc/pthreads/include/Makefile.in b/usr.sbin/bind/lib/isc/pthreads/include/Makefile.in
index 0408e2ffb77..01fdc099eef 100644
--- a/usr.sbin/bind/lib/isc/pthreads/include/Makefile.in
+++ b/usr.sbin/bind/lib/isc/pthreads/include/Makefile.in
@@ -1,5 +1,4 @@
-# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 1998-2001 Internet Software Consortium.
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -13,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2019/12/16 16:16:27 deraadt Exp $
+# $Id: Makefile.in,v 1.3 2019/12/17 01:46:36 sthen Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/usr.sbin/bind/lib/isc/pthreads/include/isc/Makefile.in b/usr.sbin/bind/lib/isc/pthreads/include/isc/Makefile.in
index 39b094de571..8900f7dcb04 100644
--- a/usr.sbin/bind/lib/isc/pthreads/include/isc/Makefile.in
+++ b/usr.sbin/bind/lib/isc/pthreads/include/isc/Makefile.in
@@ -1,5 +1,4 @@
-# Copyright (C) 2004, 2007, 2012, 2015, 2016 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 1998-2001 Internet Software Consortium.
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -13,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2019/12/16 16:16:27 deraadt Exp $
+# $Id: Makefile.in,v 1.3 2019/12/17 01:46:36 sthen Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/usr.sbin/bind/lib/isc/pthreads/include/isc/condition.h b/usr.sbin/bind/lib/isc/pthreads/include/isc/condition.h
index 9c6be8dfb9a..8f25c4d9628 100644
--- a/usr.sbin/bind/lib/isc/pthreads/include/isc/condition.h
+++ b/usr.sbin/bind/lib/isc/pthreads/include/isc/condition.h
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: condition.h,v 1.2 2019/12/16 16:16:27 deraadt Exp $ */
+/* $Id: condition.h,v 1.3 2019/12/17 01:46:36 sthen Exp $ */
#ifndef ISC_CONDITION_H
#define ISC_CONDITION_H 1
diff --git a/usr.sbin/bind/lib/isc/pthreads/include/isc/mutex.h b/usr.sbin/bind/lib/isc/pthreads/include/isc/mutex.h
index 4241347bb20..e56c43c1d06 100644
--- a/usr.sbin/bind/lib/isc/pthreads/include/isc/mutex.h
+++ b/usr.sbin/bind/lib/isc/pthreads/include/isc/mutex.h
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mutex.h,v 1.2 2019/12/16 16:16:27 deraadt Exp $ */
+/* $Id: mutex.h,v 1.3 2019/12/17 01:46:36 sthen Exp $ */
#ifndef ISC_MUTEX_H
#define ISC_MUTEX_H 1
@@ -72,7 +71,7 @@ typedef pthread_mutex_t isc_mutex_t;
#else
#if ISC_MUTEX_DEBUG && defined(PTHREAD_MUTEX_ERRORCHECK)
#define isc_mutex_init(mp) \
- isc_mutex_init_errcheck((mp))
+ isc_mutex_init_errcheck((mp))
#else
#define isc_mutex_init(mp) \
isc__mutex_init((mp), __FILE__, __LINE__)
diff --git a/usr.sbin/bind/lib/isc/pthreads/include/isc/once.h b/usr.sbin/bind/lib/isc/pthreads/include/isc/once.h
index f617856405e..295c3abe814 100644
--- a/usr.sbin/bind/lib/isc/pthreads/include/isc/once.h
+++ b/usr.sbin/bind/lib/isc/pthreads/include/isc/once.h
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: once.h,v 1.2 2019/12/16 16:16:27 deraadt Exp $ */
+/* $Id: once.h,v 1.3 2019/12/17 01:46:36 sthen Exp $ */
#ifndef ISC_ONCE_H
#define ISC_ONCE_H 1
diff --git a/usr.sbin/bind/lib/isc/pthreads/include/isc/thread.h b/usr.sbin/bind/lib/isc/pthreads/include/isc/thread.h
index b25f398ad21..7fe56e52d2b 100644
--- a/usr.sbin/bind/lib/isc/pthreads/include/isc/thread.h
+++ b/usr.sbin/bind/lib/isc/pthreads/include/isc/thread.h
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007, 2013 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: thread.h,v 1.2 2019/12/16 16:16:27 deraadt Exp $ */
+/* $Id: thread.h,v 1.3 2019/12/17 01:46:36 sthen Exp $ */
#ifndef ISC_THREAD_H
#define ISC_THREAD_H 1
@@ -24,6 +23,10 @@
#include <pthread.h>
+#if defined(HAVE_PTHREAD_NP_H)
+#include <pthread_np.h>
+#endif
+
#include <isc/lang.h>
#include <isc/result.h>
@@ -44,6 +47,9 @@ isc_thread_setconcurrency(unsigned int level);
void
isc_thread_yield(void);
+void
+isc_thread_setname(isc_thread_t thread, const char *name);
+
/* XXX We could do fancier error handling... */
#define isc_thread_join(t, rp) \
diff --git a/usr.sbin/bind/lib/isc/pthreads/mutex.c b/usr.sbin/bind/lib/isc/pthreads/mutex.c
index 8f8444daceb..5e17208d8f8 100644
--- a/usr.sbin/bind/lib/isc/pthreads/mutex.c
+++ b/usr.sbin/bind/lib/isc/pthreads/mutex.c
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007, 2008, 2011, 2012, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2002 Internet Software Consortium.
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mutex.c,v 1.2 2019/12/16 16:16:27 deraadt Exp $ */
+/* $Id: mutex.c,v 1.3 2019/12/17 01:46:36 sthen Exp $ */
/*! \file */
diff --git a/usr.sbin/bind/lib/isc/pthreads/thread.c b/usr.sbin/bind/lib/isc/pthreads/thread.c
index 7a2a9f396d6..2c5dea766c5 100644
--- a/usr.sbin/bind/lib/isc/pthreads/thread.c
+++ b/usr.sbin/bind/lib/isc/pthreads/thread.c
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007, 2013 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: thread.c,v 1.6 2019/12/16 16:16:27 deraadt Exp $ */
+/* $Id: thread.c,v 1.7 2019/12/17 01:46:36 sthen Exp $ */
/*! \file */
@@ -37,7 +36,10 @@ isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg,
isc_thread_t *thread)
{
pthread_attr_t attr;
+#if defined(HAVE_PTHREAD_ATTR_GETSTACKSIZE) && \
+ defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
size_t stacksize;
+#endif
int ret;
pthread_attr_init(&attr);
@@ -80,6 +82,22 @@ isc_thread_setconcurrency(unsigned int level) {
}
void
+isc_thread_setname(isc_thread_t thread, const char *name) {
+#if defined(HAVE_PTHREAD_SETNAME_NP) && defined(_GNU_SOURCE)
+ /*
+ * macOS has pthread_setname_np but only works on the
+ * current thread so it's not used here
+ */
+ (void)pthread_setname_np(thread, name);
+#elif defined(HAVE_PTHREAD_SET_NAME_NP)
+ (void)pthread_set_name_np(thread, name);
+#else
+ UNUSED(thread);
+ UNUSED(name);
+#endif
+}
+
+void
isc_thread_yield(void) {
#if defined(HAVE_SCHED_YIELD)
sched_yield();