#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>
#include <string.h>
#include <unistd.h>
-#include <isc/condition.h>
#include <isc/log.h>
#include <isc/loop.h>
#include <isc/mutex.h>
#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>
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 \
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 \
base32.c \
base64.c \
commandline.c \
- condition.c \
counter.c \
crypto.c \
dir.c \
meminfo.c \
mutex.c \
mutex_p.h \
- mutexblock.c \
net.c \
netaddr.c \
netscope.c \
#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>
+++ /dev/null
-/*
- * 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;
-}
#include <isc/atomic.h>
#include <isc/barrier.h>
-#include <isc/condition.h>
#include <isc/helper.h>
#include <isc/job.h>
#include <isc/loop.h>
+++ /dev/null
-/*
- * 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 *);
+++ /dev/null
-/*
- * 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().
- *
- */
#include <isc/atomic.h>
#include <isc/barrier.h>
-#include <isc/condition.h>
#include <isc/job.h>
#include <isc/list.h>
#include <isc/loop.h>
#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>
+++ /dev/null
-/*
- * 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]);
- }
-}
#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>
#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>
#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>
#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>
#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>
#include <isc/async.h>
#include <isc/atomic.h>
-#include <isc/condition.h>
#include <isc/heap.h>
#include <isc/job.h>
#include <isc/log.h>
#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>
#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>
#include <isc/atomic.h>
#include <isc/commandline.h>
-#include <isc/condition.h>
#include <isc/job.h>
#include <isc/lib.h>
#include <isc/loop.h>