2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

convert to util.h

This commit is contained in:
Bob Halley
1998-12-13 02:04:22 +00:00
parent 674dd7889b
commit a3002fd5a2
2 changed files with 3 additions and 28 deletions

View File

@@ -24,16 +24,7 @@
#include <isc/boolean.h>
#include <isc/rwlock.h>
#define LOCK(lp) \
INSIST(isc_mutex_lock((lp)) == ISC_R_SUCCESS);
#define UNLOCK(lp) \
INSIST(isc_mutex_unlock((lp)) == ISC_R_SUCCESS);
#define BROADCAST(cvp) \
INSIST(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS);
#define SIGNAL(cvp) \
INSIST(isc_condition_signal((cvp)) == ISC_R_SUCCESS);
#define WAIT(cvp, lp) \
INSIST(isc_condition_wait((cvp), (lp)) == ISC_R_SUCCESS);
#include "util.h"
#define RWLOCK_MAGIC 0x52574C6BU /* RWLk. */
#define VALID_RWLOCK(rwl) ((rwl) != NULL && \

View File

@@ -34,28 +34,12 @@
#include <isc/condition.h>
#include <isc/socket.h>
#include "util.h"
#ifndef _WIN32
#define WINAPI /* we're not windows */
#endif
/*
* We use macros instead of calling the routines directly because
* the capital letters make the locking stand out.
*
* We INSIST that they succeed since there's no way for us to continue
* if they fail.
*/
#define LOCK(lp) do { \
INSIST(isc_mutex_lock((lp)) == ISC_R_SUCCESS); \
XTRACE(TRACE_LOCK, ("%d locked socket %p\n", __LINE__, lp)); \
} while (0)
#define UNLOCK(lp) do { \
INSIST(isc_mutex_unlock((lp)) == ISC_R_SUCCESS); \
XTRACE(TRACE_LOCK, ("%d unlocked socket %p\n", __LINE__, lp)); \
} while (0)
#define ISC_TASK_SEND(a, b) do { \
INSIST(isc_task_send(a, b) == ISC_R_SUCCESS); \
} while (0);