diff options
| author | 2020-01-26 11:25:30 +0000 | |
|---|---|---|
| committer | 2020-01-26 11:25:30 +0000 | |
| commit | 48ee3a44a2335b7b9843dd51a4b8a967e6c07a82 (patch) | |
| tree | 2e3acf6d75d19747066aec1dad15cb5ce5370a20 | |
| parent | Switch once to isc_boolean_t in preparation of nothreads removal (diff) | |
| download | wireguard-openbsd-48ee3a44a2335b7b9843dd51a4b8a967e6c07a82.tar.xz wireguard-openbsd-48ee3a44a2335b7b9843dd51a4b8a967e6c07a82.zip | |
get rid of lib/isc/nothreads
OK tedu
| -rw-r--r-- | usr.sbin/bind/configure | 5 | ||||
| -rw-r--r-- | usr.sbin/bind/configure.in | 3 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/dns/dst_api.c | 15 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/dns/name.c | 10 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/dns/openssl_link.c | 3 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/Makefile.in | 7 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/include/isc/util.h | 23 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/nothreads/Makefile.in | 39 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/nothreads/condition.c | 23 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/nothreads/include/Makefile.in | 24 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/nothreads/include/isc/Makefile.in | 41 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/nothreads/include/isc/condition.h | 56 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/nothreads/include/isc/once.h | 31 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/nothreads/include/isc/thread.h | 46 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/nothreads/thread.c | 32 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/task.c | 13 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/timer.c | 8 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/unix/app.c | 57 | ||||
| -rw-r--r-- | usr.sbin/bind/lib/isc/unix/socket.c | 3 |
19 files changed, 10 insertions, 429 deletions
diff --git a/usr.sbin/bind/configure b/usr.sbin/bind/configure index b56f612902d..205ade7b723 100644 --- a/usr.sbin/bind/configure +++ b/usr.sbin/bind/configure @@ -11976,7 +11976,7 @@ DNS_CRYPTO_LIBS="$NEWFLAGS" # elsewhere if there's a good reason for doing so. # -ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/dig/Makefile lib/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/isc/nothreads/Makefile lib/isc/nothreads/include/Makefile lib/isc/nothreads/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/lwres/Makefile" +ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/dig/Makefile lib/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/lwres/Makefile" # @@ -12989,9 +12989,6 @@ do "lib/dns/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dns/include/Makefile" ;; "lib/dns/include/dns/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dns/include/dns/Makefile" ;; "lib/dns/include/dst/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dns/include/dst/Makefile" ;; - "lib/isc/nothreads/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isc/nothreads/Makefile" ;; - "lib/isc/nothreads/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isc/nothreads/include/Makefile" ;; - "lib/isc/nothreads/include/isc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isc/nothreads/include/isc/Makefile" ;; "lib/isc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isc/Makefile" ;; "lib/isc/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isc/include/Makefile" ;; "lib/isc/include/isc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isc/include/isc/Makefile" ;; diff --git a/usr.sbin/bind/configure.in b/usr.sbin/bind/configure.in index 2be89183633..f2e9d349e85 100644 --- a/usr.sbin/bind/configure.in +++ b/usr.sbin/bind/configure.in @@ -657,9 +657,6 @@ AC_CONFIG_FILES([ lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile - lib/isc/nothreads/Makefile - lib/isc/nothreads/include/Makefile - lib/isc/nothreads/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile diff --git a/usr.sbin/bind/lib/dns/dst_api.c b/usr.sbin/bind/lib/dns/dst_api.c index a4097ae0b7b..aaee771daf5 100644 --- a/usr.sbin/bind/lib/dns/dst_api.c +++ b/usr.sbin/bind/lib/dns/dst_api.c @@ -33,36 +33,23 @@ /* * Principal Author: Brian Wellington - * $Id: dst_api.c,v 1.21 2020/01/26 11:23:42 florian Exp $ + * $Id: dst_api.c,v 1.22 2020/01/26 11:25:30 florian Exp $ */ /*! \file */ - - - #include <stdlib.h> #include <time.h> #include <isc/buffer.h> #include <isc/dir.h> - - #include <isc/hmacsha.h> #include <isc/lex.h> - -#include <isc/once.h> - - #include <isc/refcount.h> - #include <isc/safe.h> #include <string.h> #include <isc/time.h> #include <isc/util.h> - - - #define DST_KEY_INTERNAL #include <dns/fixedname.h> diff --git a/usr.sbin/bind/lib/dns/name.c b/usr.sbin/bind/lib/dns/name.c index 482cb44a4bf..6063c4f13ad 100644 --- a/usr.sbin/bind/lib/dns/name.c +++ b/usr.sbin/bind/lib/dns/name.c @@ -14,23 +14,15 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.c,v 1.22 2020/01/22 13:02:09 florian Exp $ */ +/* $Id: name.c,v 1.23 2020/01/26 11:25:30 florian Exp $ */ /*! \file */ - - - #include <ctype.h> #include <stdlib.h> - #include <isc/buffer.h> #include <isc/hash.h> -#include <isc/once.h> - - #include <string.h> -#include <isc/thread.h> #include <isc/util.h> #include <dns/compress.h> diff --git a/usr.sbin/bind/lib/dns/openssl_link.c b/usr.sbin/bind/lib/dns/openssl_link.c index 3e5fec1f43b..31c88539221 100644 --- a/usr.sbin/bind/lib/dns/openssl_link.c +++ b/usr.sbin/bind/lib/dns/openssl_link.c @@ -35,12 +35,9 @@ * Principal Author: Brian Wellington */ - #include <stdlib.h> - #include <string.h> -#include <isc/thread.h> #include <isc/util.h> #include <dns/log.h> diff --git a/usr.sbin/bind/lib/isc/Makefile.in b/usr.sbin/bind/lib/isc/Makefile.in index 4f7262e4ee7..ad6b78c9f3e 100644 --- a/usr.sbin/bind/lib/isc/Makefile.in +++ b/usr.sbin/bind/lib/isc/Makefile.in @@ -21,7 +21,6 @@ top_srcdir = @top_srcdir@ @BIND9_MAKE_INCLUDES@ CINCLUDES = -I${srcdir}/unix/include \ - -I${srcdir}/nothreads/include \ -I./include \ -I${srcdir}/include ${DNS_INCLUDES} CDEFINES = @@ -35,10 +34,6 @@ UNIXOBJS = \ unix/socket.@O@ unix/stdio.@O@ \ unix/stdtime.@O@ unix/strerror.@O@ unix/time.@O@ -THREADOPTOBJS = nothreads/condition.@O@ - -THREADOBJS = nothreads/thread.@O@ - # Alphabetically OBJS = \ aes.@O@ assertions.@O@ base32.@O@ base64.@O@ \ @@ -54,7 +49,7 @@ OBJS = \ safe.@O@ serial.@O@ sha1.@O@ sha2.@O@ sockaddr.@O@ \ symtab.@O@ task.@O@ \ timer.@O@ \ - ${UNIXOBJS} ${THREADOBJS} + ${UNIXOBJS} # Alphabetically SRCS = \ diff --git a/usr.sbin/bind/lib/isc/include/isc/util.h b/usr.sbin/bind/lib/isc/include/isc/util.h index 136c6826c1d..13fe9a8b0a1 100644 --- a/usr.sbin/bind/lib/isc/include/isc/util.h +++ b/usr.sbin/bind/lib/isc/include/isc/util.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: util.h,v 1.7 2020/01/25 10:43:06 florian Exp $ */ +/* $Id: util.h,v 1.8 2020/01/26 11:25:30 florian Exp $ */ #ifndef ISC_UTIL_H #define ISC_UTIL_H 1 @@ -86,27 +86,6 @@ */ #include <isc/result.h> /* Contractual promise. */ - -#define BROADCAST(cvp) do { \ - RUNTIME_CHECK(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS); \ - } while (0) -#define SIGNAL(cvp) do { \ - RUNTIME_CHECK(isc_condition_signal((cvp)) == ISC_R_SUCCESS); \ - } while (0) -#define WAIT(cvp, lp) do { \ - RUNTIME_CHECK(isc_condition_wait((cvp), (lp)) == ISC_R_SUCCESS); \ - } while (0) - -/* - * isc_condition_waituntil can return ISC_R_TIMEDOUT, so we - * don't RUNTIME_CHECK the result. - * - * XXX Also, can't really debug this then... - */ - -#define WAITUNTIL(cvp, lp, tp) \ - isc_condition_waituntil((cvp), (lp), (tp)) - /* * List Macros. */ diff --git a/usr.sbin/bind/lib/isc/nothreads/Makefile.in b/usr.sbin/bind/lib/isc/nothreads/Makefile.in deleted file mode 100644 index b3fec8ea207..00000000000 --- a/usr.sbin/bind/lib/isc/nothreads/Makefile.in +++ /dev/null @@ -1,39 +0,0 @@ -# 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 -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -# PERFORMANCE OF THIS SOFTWARE. - -# $Id: Makefile.in,v 1.4 2020/01/07 19:08:09 florian Exp $ - -top_srcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -CINCLUDES = -I${srcdir}/include \ - -I${srcdir}/../unix/include \ - -I../include \ - -I${srcdir}/../include \ - -I${srcdir}/.. - -CDEFINES = -CWARNINGS = - -THREADOPTOBJS = condition.@O@ mutex.@O@ -OBJS = thread.@O@ - -THREADOPTSRCS = condition.c mutex.c -SRCS = thread.c - -SUBDIRS = include -TARGETS = ${OBJS} - -@BIND9_MAKE_RULES@ diff --git a/usr.sbin/bind/lib/isc/nothreads/condition.c b/usr.sbin/bind/lib/isc/nothreads/condition.c deleted file mode 100644 index 00006768827..00000000000 --- a/usr.sbin/bind/lib/isc/nothreads/condition.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: condition.c,v 1.4 2020/01/22 13:02:10 florian Exp $ */ - - - -#include <isc/util.h> - -EMPTY_TRANSLATION_UNIT diff --git a/usr.sbin/bind/lib/isc/nothreads/include/Makefile.in b/usr.sbin/bind/lib/isc/nothreads/include/Makefile.in deleted file mode 100644 index 01fdc099eef..00000000000 --- a/usr.sbin/bind/lib/isc/nothreads/include/Makefile.in +++ /dev/null @@ -1,24 +0,0 @@ -# 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 -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -# PERFORMANCE OF THIS SOFTWARE. - -# $Id: Makefile.in,v 1.3 2019/12/17 01:46:36 sthen Exp $ - -srcdir = @srcdir@ -VPATH = @srcdir@ -top_srcdir = @top_srcdir@ - -SUBDIRS = isc -TARGETS = - -@BIND9_MAKE_RULES@ diff --git a/usr.sbin/bind/lib/isc/nothreads/include/isc/Makefile.in b/usr.sbin/bind/lib/isc/nothreads/include/isc/Makefile.in deleted file mode 100644 index ec56e0d6e02..00000000000 --- a/usr.sbin/bind/lib/isc/nothreads/include/isc/Makefile.in +++ /dev/null @@ -1,41 +0,0 @@ -# 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 -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -# PERFORMANCE OF THIS SOFTWARE. - -# $Id: Makefile.in,v 1.4 2020/01/21 23:59:20 tedu Exp $ - -srcdir = @srcdir@ -VPATH = @srcdir@ -top_srcdir = @top_srcdir@ - -VERSION=@BIND9_VERSION@ - -HEADERS = condition.h once.h thread.h - -SUBDIRS = -TARGETS = - -@BIND9_MAKE_RULES@ - -installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}/isc - -install:: installdirs - for i in ${HEADERS}; do \ - ${INSTALL_DATA} $(srcdir)/$$i ${DESTDIR}${includedir}/isc ; \ - done - -uninstall:: - for i in ${HEADERS}; do \ - rm -f ${DESTDIR}${includedir}/isc/$$i ; \ - done diff --git a/usr.sbin/bind/lib/isc/nothreads/include/isc/condition.h b/usr.sbin/bind/lib/isc/nothreads/include/isc/condition.h deleted file mode 100644 index 81da3f636c5..00000000000 --- a/usr.sbin/bind/lib/isc/nothreads/include/isc/condition.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: condition.h,v 1.4 2020/01/21 23:59:20 tedu Exp $ */ - -/* - * This provides a limited subset of the isc_condition_t - * functionality for use by single-threaded programs that - * need to block waiting for events. Only a single - * call to isc_condition_wait() may be blocked at any given - * time, and the _waituntil and _broadcast functions are not - * supported. This is intended primarily for use by the omapi - * library, and may go away once omapi goes away. Use for - * other purposes is strongly discouraged. - */ - -#ifndef ISC_CONDITION_H -#define ISC_CONDITION_H 1 - -typedef int isc_condition_t; - -isc_result_t isc__nothread_wait_hack(isc_condition_t *cp); -isc_result_t isc__nothread_signal_hack(isc_condition_t *cp); - -#define isc_condition_init(cp) \ - (*(cp) = 0, ISC_R_SUCCESS) - -#define isc_condition_wait(cp, mp) \ - isc__nothread_wait_hack(cp) - -#define isc_condition_waituntil(cp, mp, tp) \ - ((void)(cp), (void)(mp), (void)(tp), ISC_R_NOTIMPLEMENTED) - -#define isc_condition_signal(cp) \ - isc__nothread_signal_hack(cp) - -#define isc_condition_broadcast(cp) \ - ((void)(cp), ISC_R_NOTIMPLEMENTED) - -#define isc_condition_destroy(cp) \ - (*(cp) == 0 ? (*(cp) = -1, ISC_R_SUCCESS) : ISC_R_UNEXPECTED) - -#endif /* ISC_CONDITION_H */ diff --git a/usr.sbin/bind/lib/isc/nothreads/include/isc/once.h b/usr.sbin/bind/lib/isc/nothreads/include/isc/once.h deleted file mode 100644 index 4bae083818a..00000000000 --- a/usr.sbin/bind/lib/isc/nothreads/include/isc/once.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: once.h,v 1.3 2019/12/17 01:46:36 sthen Exp $ */ - -#ifndef ISC_ONCE_H -#define ISC_ONCE_H 1 - -#include <isc/result.h> - -typedef isc_boolean_t isc_once_t; - -#define ISC_ONCE_INIT ISC_FALSE - -#define isc_once_do(op, f) \ - (!*(op) ? (f(), *(op) = ISC_TRUE, ISC_R_SUCCESS) : ISC_R_SUCCESS) - -#endif /* ISC_ONCE_H */ diff --git a/usr.sbin/bind/lib/isc/nothreads/include/isc/thread.h b/usr.sbin/bind/lib/isc/nothreads/include/isc/thread.h deleted file mode 100644 index fc3e6dfda88..00000000000 --- a/usr.sbin/bind/lib/isc/nothreads/include/isc/thread.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: thread.h,v 1.3 2019/12/17 01:46:36 sthen Exp $ */ - -#ifndef ISC_THREAD_H -#define ISC_THREAD_H 1 - -#include <isc/lang.h> -#include <isc/result.h> - -ISC_LANG_BEGINDECLS - -/* Placeholder types (they are not accessed) */ - -typedef void * isc_thread_t; -typedef void * isc_threadresult_t; -typedef void * isc_threadarg_t; -typedef void * isc_threadfunc_t; -typedef void * isc_thread_key_t; - -void -isc_thread_setconcurrency(unsigned int level); - -void -isc_thread_setname(isc_thread_t thread, const char *name); - -#define isc_thread_self() ((unsigned long)0) -#define isc_thread_yield() ((void)0) - -ISC_LANG_ENDDECLS - -#endif /* ISC_THREAD_H */ diff --git a/usr.sbin/bind/lib/isc/nothreads/thread.c b/usr.sbin/bind/lib/isc/nothreads/thread.c deleted file mode 100644 index 69564e86883..00000000000 --- a/usr.sbin/bind/lib/isc/nothreads/thread.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: thread.c,v 1.4 2020/01/22 13:02:10 florian Exp $ */ - - - -#include <isc/thread.h> -#include <isc/util.h> - -void -isc_thread_setconcurrency(unsigned int level) { - UNUSED(level); -} - -void isc_thread_setname(isc_thread_t thread, const char *name) { - UNUSED(thread); - UNUSED(name); -} diff --git a/usr.sbin/bind/lib/isc/task.c b/usr.sbin/bind/lib/isc/task.c index 66df95bac6a..e9d5e92b3ae 100644 --- a/usr.sbin/bind/lib/isc/task.c +++ b/usr.sbin/bind/lib/isc/task.c @@ -23,32 +23,25 @@ * for changing states. */ - #include <stdlib.h> #include <isc/app.h> -#include <isc/condition.h> #include <isc/event.h> - #include <isc/magic.h> - #include <isc/msgs.h> -#include <isc/once.h> - #include <string.h> #include <isc/task.h> -#include <isc/thread.h> #include <isc/util.h> #include "task_p.h" #ifdef ISC_TASK_TRACE #define XTRACE(m) fprintf(stderr, "task %p thread %lu: %s\n", \ - task, isc_thread_self(), (m)) + task, 0, (m)) #define XTTRACE(t, m) fprintf(stderr, "task %p thread %lu: %s\n", \ - (t), isc_thread_self(), (m)) + (t), 0, (m)) #define XTHREADTRACE(m) fprintf(stderr, "thread %lu: %s\n", \ - isc_thread_self(), (m)) + 0, (m)) #else #define XTRACE(m) #define XTTRACE(t, m) diff --git a/usr.sbin/bind/lib/isc/timer.c b/usr.sbin/bind/lib/isc/timer.c index 5f298395774..9707ef16a59 100644 --- a/usr.sbin/bind/lib/isc/timer.c +++ b/usr.sbin/bind/lib/isc/timer.c @@ -14,24 +14,18 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: timer.c,v 1.15 2020/01/22 13:02:10 florian Exp $ */ +/* $Id: timer.c,v 1.16 2020/01/26 11:25:30 florian Exp $ */ /*! \file */ #include <stdlib.h> #include <isc/app.h> -#include <isc/condition.h> #include <isc/heap.h> #include <isc/log.h> #include <isc/magic.h> - #include <isc/msgs.h> -#include <isc/once.h> - - #include <isc/task.h> -#include <isc/thread.h> #include <isc/time.h> #include <isc/timer.h> #include <isc/util.h> diff --git a/usr.sbin/bind/lib/isc/unix/app.c b/usr.sbin/bind/lib/isc/unix/app.c index d188990d624..555a81340e8 100644 --- a/usr.sbin/bind/lib/isc/unix/app.c +++ b/usr.sbin/bind/lib/isc/unix/app.c @@ -30,7 +30,7 @@ #include <isc/app.h> #include <isc/boolean.h> -#include <isc/condition.h> + #include <isc/msgs.h> #include <isc/event.h> @@ -376,61 +376,6 @@ evloop(isc__appctx_t *ctx) { return (ISC_R_SUCCESS); } -/* - * This is a gross hack to support waiting for condition - * variables in nonthreaded programs in a limited way; - * see lib/isc/nothreads/include/isc/condition.h. - * We implement isc_condition_wait() by entering the - * event loop recursively until the want_shutdown flag - * is set by isc_condition_signal(). - */ - -/*! - * \brief True if we are currently executing in the recursive - * event loop. - */ -static isc_boolean_t in_recursive_evloop = ISC_FALSE; - -/*! - * \brief True if we are exiting the event loop as the result of - * a call to isc_condition_signal() rather than a shutdown - * or reload. - */ -static isc_boolean_t signalled = ISC_FALSE; - -isc_result_t -isc__nothread_wait_hack(isc_condition_t *cp) { - isc_result_t result; - - UNUSED(cp); - - INSIST(!in_recursive_evloop); - in_recursive_evloop = ISC_TRUE; - - result = evloop(&isc_g_appctx); - if (result == ISC_R_RELOAD) - isc_g_appctx.want_reload = ISC_TRUE; - if (signalled) { - isc_g_appctx.want_shutdown = ISC_FALSE; - signalled = ISC_FALSE; - } - - in_recursive_evloop = ISC_FALSE; - return (ISC_R_SUCCESS); -} - -isc_result_t -isc__nothread_signal_hack(isc_condition_t *cp) { - - UNUSED(cp); - - INSIST(in_recursive_evloop); - - isc_g_appctx.want_shutdown = ISC_TRUE; - signalled = ISC_TRUE; - return (ISC_R_SUCCESS); -} - isc_result_t isc__app_ctxrun(isc_appctx_t *ctx0) { isc__appctx_t *ctx = (isc__appctx_t *)ctx0; diff --git a/usr.sbin/bind/lib/isc/unix/socket.c b/usr.sbin/bind/lib/isc/unix/socket.c index 95322c83e3d..2c18d2b2cad 100644 --- a/usr.sbin/bind/lib/isc/unix/socket.c +++ b/usr.sbin/bind/lib/isc/unix/socket.c @@ -37,18 +37,15 @@ #include <isc/buffer.h> #include <isc/bufferlist.h> -#include <isc/condition.h> #include <isc/formatcheck.h> #include <isc/list.h> #include <isc/log.h> #include <isc/msgs.h> #include <isc/net.h> -#include <isc/once.h> #include <isc/region.h> #include <isc/socket.h> #include <isc/strerror.h> #include <isc/task.h> -#include <isc/thread.h> #include <isc/util.h> #include "errno2result.h" |
