Commit a3002fd5 authored by Bob Halley's avatar Bob Halley
Browse files

convert to util.h

parent 674dd788
......@@ -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 && \
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment