]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove unused isc_mutexblock and isc_condition units
authorOndřej Surý <ondrej@isc.org>
Fri, 28 Feb 2025 20:01:29 +0000 (21:01 +0100)
committerOndřej Surý <ondrej@isc.org>
Sat, 1 Mar 2025 06:33:09 +0000 (07:33 +0100)
The isc_mutexblock and isc_condition units were no longer in use and
were removed.

21 files changed:
bin/dig/nslookup.c
bin/named/fuzz.c
lib/dns/openssl_link.c
lib/isc/Makefile.am
lib/isc/async.c
lib/isc/condition.c [deleted file]
lib/isc/helper.c
lib/isc/include/isc/condition.h [deleted file]
lib/isc/include/isc/mutexblock.h [deleted file]
lib/isc/job.c
lib/isc/loop.c
lib/isc/mutexblock.c [deleted file]
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/tcp.c
lib/isc/netmgr/tlsstream.c
lib/isc/netmgr/udp.c
lib/isc/timer.c
lib/isc/tls.c
tests/isc/doh_test.c
tests/isc/timer_test.c

index ca362918814342ad219cebb4bbe2c210479710c6..68116749dd0e591a117fd5f5a8db8379d3319e1b 100644 (file)
@@ -20,7 +20,6 @@
 #include <isc/attributes.h>
 #include <isc/buffer.h>
 #include <isc/commandline.h>
-#include <isc/condition.h>
 #include <isc/lib.h>
 #include <isc/loop.h>
 #include <isc/netaddr.h>
index 25804892ebc5874728e6258b44371876c5c34dc9..974259091934ff4313be392e181e4cf74667622c 100644 (file)
@@ -25,7 +25,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <isc/condition.h>
 #include <isc/log.h>
 #include <isc/loop.h>
 #include <isc/mutex.h>
index b693bc3789fdaecd65ce949dc2965e046856aa75..9f06b54553c5e103ecd03c51921c1c622ec090f6 100644 (file)
@@ -30,7 +30,6 @@
 #include <isc/log.h>
 #include <isc/mem.h>
 #include <isc/mutex.h>
-#include <isc/mutexblock.h>
 #include <isc/result.h>
 #include <isc/string.h>
 #include <isc/thread.h>
index 4978ab4ed100078dc08d3acf3683fefeb6eea5c4..3ccee9a520466ae39bcc95ec6ac86e9fea0660f8 100644 (file)
@@ -15,7 +15,6 @@ libisc_la_HEADERS =                   \
        include/isc/base64.h            \
        include/isc/buffer.h            \
        include/isc/commandline.h       \
-       include/isc/condition.h         \
        include/isc/counter.h           \
        include/isc/crypto.h            \
        include/isc/dir.h               \
@@ -51,7 +50,6 @@ libisc_la_HEADERS =                   \
        include/isc/mem.h               \
        include/isc/meminfo.h           \
        include/isc/mutex.h             \
-       include/isc/mutexblock.h        \
        include/isc/net.h               \
        include/isc/netaddr.h           \
        include/isc/netmgr.h            \
@@ -122,7 +120,6 @@ libisc_la_SOURCES =         \
        base32.c                \
        base64.c                \
        commandline.c           \
-       condition.c             \
        counter.c               \
        crypto.c                \
        dir.c                   \
@@ -159,7 +156,6 @@ libisc_la_SOURCES =         \
        meminfo.c               \
        mutex.c                 \
        mutex_p.h               \
-       mutexblock.c            \
        net.c                   \
        netaddr.c               \
        netscope.c              \
index 351b213a14c9ce73424e1bc8fe0d64f54db7c063..acb5585e09a14040541771f8aad045b20b2de4ff 100644 (file)
@@ -18,7 +18,6 @@
 #include <isc/async.h>
 #include <isc/atomic.h>
 #include <isc/barrier.h>
-#include <isc/condition.h>
 #include <isc/job.h>
 #include <isc/loop.h>
 #include <isc/magic.h>
diff --git a/lib/isc/condition.c b/lib/isc/condition.c
deleted file mode 100644 (file)
index 722a599..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/*! \file */
-
-#include <errno.h>
-
-#include <isc/condition.h>
-#include <isc/strerr.h>
-#include <isc/string.h>
-#include <isc/time.h>
-#include <isc/util.h>
-
-isc_result_t
-isc__condition_waituntil(pthread_cond_t *c, pthread_mutex_t *m, isc_time_t *t) {
-       int presult;
-       isc_result_t result;
-       struct timespec ts;
-
-       REQUIRE(c != NULL && m != NULL && t != NULL);
-
-       /*
-        * POSIX defines a timespec's tv_sec as time_t.
-        */
-       result = isc_time_secondsastimet(t, &ts.tv_sec);
-
-       /*
-        * If we have a range error ts.tv_sec is most probably a signed
-        * 32 bit value.  Set ts.tv_sec to INT_MAX.  This is a kludge.
-        */
-       if (result == ISC_R_RANGE) {
-               ts.tv_sec = INT_MAX;
-       } else if (result != ISC_R_SUCCESS) {
-               return result;
-       }
-
-       /*!
-        * POSIX defines a timespec's tv_nsec as long.  isc_time_nanoseconds
-        * ensures its return value is < 1 billion, which will fit in a long.
-        */
-       ts.tv_nsec = (long)isc_time_nanoseconds(t);
-
-       do {
-               presult = pthread_cond_timedwait(c, m, &ts);
-               if (presult == 0) {
-                       return ISC_R_SUCCESS;
-               }
-               if (presult == ETIMEDOUT) {
-                       return ISC_R_TIMEDOUT;
-               }
-       } while (presult == EINTR);
-
-       UNEXPECTED_SYSERROR(presult, "pthread_cond_timedwait()");
-       return ISC_R_UNEXPECTED;
-}
index f5a83cc8333d3a4b9ccdb01aa0080288cf22726b..1644c244eff7627e0ad838be25551e557f927235 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <isc/atomic.h>
 #include <isc/barrier.h>
-#include <isc/condition.h>
 #include <isc/helper.h>
 #include <isc/job.h>
 #include <isc/loop.h>
diff --git a/lib/isc/include/isc/condition.h b/lib/isc/include/isc/condition.h
deleted file mode 100644 (file)
index 27f2b80..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-#pragma once
-
-/*! \file */
-
-#include <errno.h>
-#include <stdlib.h>
-
-#include <isc/error.h>
-#include <isc/mutex.h>
-#include <isc/result.h>
-#include <isc/string.h>
-#include <isc/types.h>
-#include <isc/util.h>
-
-/*
- * We use macros instead of static inline functions so that the exact code
- * location can be reported when PTHREADS_RUNTIME_CHECK() fails or when mutrace
- * reports lock contention.
- */
-
-#ifdef ISC_TRACK_PTHREADS_OBJECTS
-
-typedef pthread_cond_t *isc_condition_t;
-
-#define isc_condition_init(cp)              \
-       {                                   \
-               *cp = malloc(sizeof(**cp)); \
-               isc__condition_init(*cp);   \
-       }
-#define isc_condition_wait(cp, mp)        isc__condition_wait(*cp, *mp)
-#define isc_condition_waituntil(cp, mp, t) isc__condition_waituntil(*cp, *mp, t)
-#define isc_condition_signal(cp)          isc__condition_signal(*cp)
-#define isc_condition_broadcast(cp)       isc__condition_broadcast(*cp)
-#define isc_condition_destroy(cp)            \
-       {                                    \
-               isc__condition_destroy(*cp); \
-               free(*cp);                   \
-       }
-
-#else /* ISC_TRACK_PTHREADS_OBJECTS */
-
-typedef pthread_cond_t isc_condition_t;
-
-#define isc_condition_init(cond)          isc__condition_init(cond)
-#define isc_condition_wait(cp, mp)        isc__condition_wait(cp, mp)
-#define isc_condition_waituntil(cp, mp, t) isc__condition_waituntil(cp, mp, t)
-#define isc_condition_signal(cp)          isc__condition_signal(cp)
-#define isc_condition_broadcast(cp)       isc__condition_broadcast(cp)
-#define isc_condition_destroy(cp)         isc__condition_destroy(cp)
-
-#endif /* ISC_TRACK_PTHREADS_OBJECTS */
-
-#define isc__condition_init(cond)                                \
-       {                                                        \
-               int _ret = pthread_cond_init(cond, NULL);        \
-               PTHREADS_RUNTIME_CHECK(pthread_cond_init, _ret); \
-       }
-
-#define isc__condition_wait(cp, mp)                              \
-       {                                                        \
-               int _ret = pthread_cond_wait(cp, mp);            \
-               PTHREADS_RUNTIME_CHECK(pthread_cond_wait, _ret); \
-       }
-
-#define isc__condition_signal(cp)                                  \
-       {                                                          \
-               int _ret = pthread_cond_signal(cp);                \
-               PTHREADS_RUNTIME_CHECK(pthread_cond_signal, _ret); \
-       }
-
-#define isc__condition_broadcast(cp)                                  \
-       {                                                             \
-               int _ret = pthread_cond_broadcast(cp);                \
-               PTHREADS_RUNTIME_CHECK(pthread_cond_broadcast, _ret); \
-       }
-
-#define isc__condition_destroy(cp)                                  \
-       {                                                           \
-               int _ret = pthread_cond_destroy(cp);                \
-               PTHREADS_RUNTIME_CHECK(pthread_cond_destroy, _ret); \
-       }
-
-isc_result_t
-isc__condition_waituntil(pthread_cond_t *, pthread_mutex_t *, isc_time_t *);
diff --git a/lib/isc/include/isc/mutexblock.h b/lib/isc/include/isc/mutexblock.h
deleted file mode 100644 (file)
index 7251efe..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-#pragma once
-
-/*! \file isc/mutexblock.h */
-
-#include <isc/mutex.h>
-#include <isc/types.h>
-
-void
-isc_mutexblock_init(isc_mutex_t *block, unsigned int count);
-/*%<
- * Initialize a block of locks.  If an error occurs all initialized locks
- * will be destroyed, if possible.
- *
- * Requires:
- *
- *\li  block != NULL
- *
- *\li  count > 0
- *
- */
-
-void
-isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count);
-/*%<
- * Destroy a block of locks.
- *
- * Requires:
- *
- *\li  block != NULL
- *
- *\li  count > 0
- *
- *\li  Each lock in the block be initialized via isc_mutex_init() or
- *     the whole block was initialized via isc_mutex_initblock().
- *
- */
index 78bbb03d0922f4e8ae18f88800bb67f17fbc1a77..d715861ca4b173d8291d8d7c9adc1f2e32065f03 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <isc/atomic.h>
 #include <isc/barrier.h>
-#include <isc/condition.h>
 #include <isc/job.h>
 #include <isc/list.h>
 #include <isc/loop.h>
index d04c4cc4ad3492384397f40f4ed6ed1ca72db52e..c1f2b540b5e0e2e2a5996c07e66d91a9cf1c4b49 100644 (file)
@@ -18,7 +18,6 @@
 #include <isc/async.h>
 #include <isc/atomic.h>
 #include <isc/barrier.h>
-#include <isc/condition.h>
 #include <isc/job.h>
 #include <isc/list.h>
 #include <isc/log.h>
diff --git a/lib/isc/mutexblock.c b/lib/isc/mutexblock.c
deleted file mode 100644 (file)
index 56a2985..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/*! \file */
-
-#include <isc/mutexblock.h>
-#include <isc/util.h>
-
-void
-isc_mutexblock_init(isc_mutex_t *block, unsigned int count) {
-       unsigned int i;
-
-       for (i = 0; i < count; i++) {
-               isc_mutex_init(&block[i]);
-       }
-}
-
-void
-isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count) {
-       unsigned int i;
-
-       for (i = 0; i < count; i++) {
-               isc_mutex_destroy(&block[i]);
-       }
-}
index e6c6e82830a492f9e29f96c1d525478031f74d4e..c42348fccef49a579ea501e941f87902a6335cae 100644 (file)
@@ -21,7 +21,6 @@
 #include <isc/atomic.h>
 #include <isc/barrier.h>
 #include <isc/buffer.h>
-#include <isc/condition.h>
 #include <isc/dnsstream.h>
 #include <isc/magic.h>
 #include <isc/mem.h>
index b88f2d9fb7047d6acd0ad689c039ed64b48c19eb..55aaa011c08d6a269a54530a611440730328a4a5 100644 (file)
@@ -20,7 +20,6 @@
 #include <isc/backtrace.h>
 #include <isc/barrier.h>
 #include <isc/buffer.h>
-#include <isc/condition.h>
 #include <isc/errno.h>
 #include <isc/job.h>
 #include <isc/list.h>
index 4f98b508623f3871f2038ce85a0662abcb6becc5..76dd0c8a7887e3b0d0ddfd6665203d259f5f6018 100644 (file)
@@ -18,7 +18,6 @@
 #include <isc/atomic.h>
 #include <isc/barrier.h>
 #include <isc/buffer.h>
-#include <isc/condition.h>
 #include <isc/errno.h>
 #include <isc/log.h>
 #include <isc/magic.h>
index 8d5fe1fd377320cf9e77123bb576d815b480c49b..b928842e298494445c27b2e42837be3d5ed1eef3 100644 (file)
@@ -21,7 +21,6 @@
 #include <isc/async.h>
 #include <isc/atomic.h>
 #include <isc/buffer.h>
-#include <isc/condition.h>
 #include <isc/log.h>
 #include <isc/magic.h>
 #include <isc/mem.h>
index ae2fea4ae119b7678b9f8bcb7dcf2339768a87d6..e8106c1b13ab04f604509077b978d2909dfbc3ad 100644 (file)
@@ -17,7 +17,6 @@
 #include <isc/atomic.h>
 #include <isc/barrier.h>
 #include <isc/buffer.h>
-#include <isc/condition.h>
 #include <isc/errno.h>
 #include <isc/magic.h>
 #include <isc/mem.h>
index bfd3377f4c30c0871eeb58f8b4012a25cf693612..504e49a16662df68338521d021cfec21641c7fbc 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <isc/async.h>
 #include <isc/atomic.h>
-#include <isc/condition.h>
 #include <isc/heap.h>
 #include <isc/job.h>
 #include <isc/log.h>
index 0a646837bbd12e3f3ed33ed6b67a68383707ebee..a52863e23ab152e022663c3fc6bf2274f42d79e1 100644 (file)
@@ -40,7 +40,6 @@
 #include <isc/magic.h>
 #include <isc/mem.h>
 #include <isc/mutex.h>
-#include <isc/mutexblock.h>
 #include <isc/once.h>
 #include <isc/random.h>
 #include <isc/refcount.h>
index 9ccc11f777120847912a2ce63c1da581bae06b20..5b98989beface802337e1558304f5ad3a9b9ffcd 100644 (file)
@@ -34,7 +34,6 @@
 #include <isc/async.h>
 #include <isc/atomic.h>
 #include <isc/buffer.h>
-#include <isc/condition.h>
 #include <isc/lib.h>
 #include <isc/mutex.h>
 #include <isc/netmgr.h>
index 4a6ee8045cf733d5b97431d20d54e69624014c53..0a5c8d01ace21b97051091b5ec24d54a3c3349d4 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <isc/atomic.h>
 #include <isc/commandline.h>
-#include <isc/condition.h>
 #include <isc/job.h>
 #include <isc/lib.h>
 #include <isc/loop.h>