mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
many name conversions
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
mem_context_t mctx = NULL;
|
||||
|
||||
static boolean_t
|
||||
static isc_boolean_t
|
||||
my_callback(task_t task, task_event_t event)
|
||||
{
|
||||
int i, j;
|
||||
@@ -24,24 +24,24 @@ my_callback(task_t task, task_event_t event)
|
||||
j += 100;
|
||||
printf("task %s: %d\n", name, j);
|
||||
|
||||
return (FALSE);
|
||||
return (ISC_FALSE);
|
||||
}
|
||||
|
||||
static boolean_t
|
||||
static isc_boolean_t
|
||||
my_shutdown(task_t task, task_event_t event) {
|
||||
char *name = event->arg;
|
||||
|
||||
printf("shutdown %s\n", name);
|
||||
return (TRUE);
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
|
||||
static boolean_t
|
||||
static isc_boolean_t
|
||||
my_tick(task_t task, task_event_t event)
|
||||
{
|
||||
char *name = event->arg;
|
||||
|
||||
printf("task %p tick %s\n", task, name);
|
||||
return (FALSE);
|
||||
return (ISC_FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -16,15 +16,15 @@ task_t t1, t2, t3;
|
||||
timer_t ti1, ti2, ti3;
|
||||
int tick_count = 0;
|
||||
|
||||
static boolean_t
|
||||
static isc_boolean_t
|
||||
shutdown_task(task_t task, task_event_t event) {
|
||||
char *name = event->arg;
|
||||
|
||||
printf("shutdown %s\n", name);
|
||||
return (TRUE);
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
|
||||
static boolean_t
|
||||
static isc_boolean_t
|
||||
tick(task_t task, task_event_t event)
|
||||
{
|
||||
char *name = event->arg;
|
||||
@@ -48,14 +48,14 @@ tick(task_t task, task_event_t event)
|
||||
interval.nanoseconds = 0;
|
||||
printf("*** resetting ti3 ***\n");
|
||||
INSIST(timer_reset(ti3, timer_type_once, expires, interval,
|
||||
TRUE)
|
||||
ISC_TRUE)
|
||||
== ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
return (ISC_FALSE);
|
||||
}
|
||||
|
||||
static boolean_t
|
||||
static isc_boolean_t
|
||||
timeout(task_t task, task_event_t event)
|
||||
{
|
||||
char *name = event->arg;
|
||||
@@ -72,9 +72,9 @@ timeout(task_t task, task_event_t event)
|
||||
|
||||
if (strcmp(name, "3") == 0) {
|
||||
printf("*** saving task 3 ***\n");
|
||||
return (FALSE);
|
||||
return (ISC_FALSE);
|
||||
}
|
||||
return (TRUE);
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -28,7 +28,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/assertions.h>
|
||||
#include <isc/boolean.h>
|
||||
#include <isc/heap.h>
|
||||
|
||||
/*
|
||||
@@ -45,26 +44,26 @@
|
||||
#define VALID_HEAP(h) ((h) != NULL && \
|
||||
(h)->magic == HEAP_MAGIC)
|
||||
|
||||
struct heap_context {
|
||||
struct isc_heap {
|
||||
unsigned int magic;
|
||||
mem_context_t mctx;
|
||||
unsigned int size;
|
||||
unsigned int size_increment;
|
||||
unsigned int last;
|
||||
void **array;
|
||||
heap_higher_priority_func higher_priority;
|
||||
heap_index_func index;
|
||||
isc_heapcompare_t compare;
|
||||
isc_heapindex_t index;
|
||||
};
|
||||
|
||||
isc_result
|
||||
heap_create(mem_context_t mctx, heap_higher_priority_func higher_priority,
|
||||
heap_index_func index, unsigned int size_increment,
|
||||
heap_t *heapp)
|
||||
isc_heap_create(mem_context_t mctx, isc_heapcompare_t compare,
|
||||
isc_heapindex_t index, unsigned int size_increment,
|
||||
isc_heap_t *heapp)
|
||||
{
|
||||
heap_t heap;
|
||||
isc_heap_t heap;
|
||||
|
||||
REQUIRE(heapp != NULL && *heapp == NULL);
|
||||
REQUIRE(higher_priority != NULL);
|
||||
REQUIRE(compare != NULL);
|
||||
|
||||
heap = mem_get(mctx, sizeof *heap);
|
||||
if (heap == NULL)
|
||||
@@ -78,7 +77,7 @@ heap_create(mem_context_t mctx, heap_higher_priority_func higher_priority,
|
||||
heap->size_increment = size_increment;
|
||||
heap->last = 0;
|
||||
heap->array = NULL;
|
||||
heap->higher_priority = higher_priority;
|
||||
heap->compare = compare;
|
||||
heap->index = index;
|
||||
|
||||
*heapp = heap;
|
||||
@@ -87,8 +86,8 @@ heap_create(mem_context_t mctx, heap_higher_priority_func higher_priority,
|
||||
}
|
||||
|
||||
void
|
||||
heap_destroy(heap_t *heapp) {
|
||||
heap_t heap;
|
||||
isc_heap_destroy(isc_heap_t *heapp) {
|
||||
isc_heap_t heap;
|
||||
|
||||
REQUIRE(heapp != NULL);
|
||||
heap = *heapp;
|
||||
@@ -103,8 +102,8 @@ heap_destroy(heap_t *heapp) {
|
||||
*heapp = NULL;
|
||||
}
|
||||
|
||||
static boolean_t
|
||||
resize(heap_t heap) {
|
||||
static isc_boolean_t
|
||||
resize(isc_heap_t heap) {
|
||||
void **new_array;
|
||||
size_t new_size;
|
||||
|
||||
@@ -113,7 +112,7 @@ resize(heap_t heap) {
|
||||
new_size = heap->size + heap->size_increment;
|
||||
new_array = mem_get(heap->mctx, new_size * sizeof (void *));
|
||||
if (new_array == NULL)
|
||||
return (FALSE);
|
||||
return (ISC_FALSE);
|
||||
if (heap->array != NULL) {
|
||||
memcpy(new_array, heap->array, heap->size);
|
||||
mem_put(heap->mctx, heap->array,
|
||||
@@ -122,15 +121,15 @@ resize(heap_t heap) {
|
||||
heap->size = new_size;
|
||||
heap->array = new_array;
|
||||
|
||||
return (TRUE);
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
float_up(heap_t heap, unsigned int i, void *elt) {
|
||||
float_up(isc_heap_t heap, unsigned int i, void *elt) {
|
||||
unsigned int p;
|
||||
|
||||
for ( p = heap_parent(i);
|
||||
i > 1 && heap->higher_priority(elt, heap->array[p]);
|
||||
i > 1 && heap->compare(elt, heap->array[p]);
|
||||
i = p, p = heap_parent(i) ) {
|
||||
heap->array[i] = heap->array[p];
|
||||
if (heap->index != NULL)
|
||||
@@ -142,7 +141,7 @@ float_up(heap_t heap, unsigned int i, void *elt) {
|
||||
}
|
||||
|
||||
static void
|
||||
sink_down(heap_t heap, unsigned int i, void *elt) {
|
||||
sink_down(isc_heap_t heap, unsigned int i, void *elt) {
|
||||
unsigned int j, size, half_size;
|
||||
|
||||
size = heap->last;
|
||||
@@ -150,10 +149,10 @@ sink_down(heap_t heap, unsigned int i, void *elt) {
|
||||
while (i <= half_size) {
|
||||
/* find smallest of the (at most) two children */
|
||||
j = heap_left(i);
|
||||
if (j < size && heap->higher_priority(heap->array[j+1],
|
||||
if (j < size && heap->compare(heap->array[j+1],
|
||||
heap->array[j]))
|
||||
j++;
|
||||
if (heap->higher_priority(elt, heap->array[j]))
|
||||
if (heap->compare(elt, heap->array[j]))
|
||||
break;
|
||||
heap->array[i] = heap->array[j];
|
||||
if (heap->index != NULL)
|
||||
@@ -166,7 +165,7 @@ sink_down(heap_t heap, unsigned int i, void *elt) {
|
||||
}
|
||||
|
||||
isc_result
|
||||
heap_insert(heap_t heap, void *elt) {
|
||||
isc_heap_insert(isc_heap_t heap, void *elt) {
|
||||
unsigned int i;
|
||||
|
||||
REQUIRE(VALID_HEAP(heap));
|
||||
@@ -181,7 +180,7 @@ heap_insert(heap_t heap, void *elt) {
|
||||
}
|
||||
|
||||
void
|
||||
heap_delete(heap_t heap, unsigned int i) {
|
||||
isc_heap_delete(isc_heap_t heap, unsigned int i) {
|
||||
void *elt;
|
||||
|
||||
REQUIRE(VALID_HEAP(heap));
|
||||
@@ -193,7 +192,7 @@ heap_delete(heap_t heap, unsigned int i) {
|
||||
}
|
||||
|
||||
void
|
||||
heap_increased(heap_t heap, unsigned int i) {
|
||||
isc_heap_increased(isc_heap_t heap, unsigned int i) {
|
||||
REQUIRE(VALID_HEAP(heap));
|
||||
REQUIRE(i >= 1 && i <= heap->last);
|
||||
|
||||
@@ -201,7 +200,7 @@ heap_increased(heap_t heap, unsigned int i) {
|
||||
}
|
||||
|
||||
void
|
||||
heap_decreased(heap_t heap, unsigned int i) {
|
||||
isc_heap_decreased(isc_heap_t heap, unsigned int i) {
|
||||
REQUIRE(VALID_HEAP(heap));
|
||||
REQUIRE(i >= 1 && i <= heap->last);
|
||||
|
||||
@@ -209,7 +208,7 @@ heap_decreased(heap_t heap, unsigned int i) {
|
||||
}
|
||||
|
||||
void *
|
||||
heap_element(heap_t heap, unsigned int i) {
|
||||
isc_heap_element(isc_heap_t heap, unsigned int i) {
|
||||
REQUIRE(VALID_HEAP(heap));
|
||||
REQUIRE(i >= 1 && i <= heap->last);
|
||||
|
||||
@@ -217,7 +216,7 @@ heap_element(heap_t heap, unsigned int i) {
|
||||
}
|
||||
|
||||
void
|
||||
heap_for_each(heap_t heap, heap_for_each_func action, void *uap) {
|
||||
isc_heap_foreach(isc_heap_t heap, isc_heapaction_t action, void *uap) {
|
||||
unsigned int i;
|
||||
|
||||
REQUIRE(VALID_HEAP(heap));
|
||||
|
@@ -1,24 +1,10 @@
|
||||
|
||||
#ifndef BOOLEAN_H
|
||||
#define BOOLEAN_H 1
|
||||
#ifndef ISC_BOOLEAN_H
|
||||
#define ISC_BOOLEAN_H 1
|
||||
|
||||
#ifndef SOLARIS
|
||||
typedef enum { isc_boolean_false = 0, isc_boolean_true = 1 } isc_boolean_t;
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#define ISC_FALSE isc_boolean_false
|
||||
#define ISC_TRUE isc_boolean_true
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
typedef enum { false=FALSE, true=TRUE } boolean_t;
|
||||
|
||||
#else
|
||||
|
||||
#define true B_TRUE
|
||||
#define false B_FALSE
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* BOOLEAN_H */
|
||||
#endif /* ISC_BOOLEAN_H */
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#define EVENT_CLASS_TASK EVENT_CLASS(0)
|
||||
|
||||
#define EVENT_CLASS_TIMER EVENT_CLASS(1)
|
||||
#define EVENT_CLASS_NET EVENT_CLASS(2)
|
||||
#define EVENT_CLASS_SOCKET EVENT_CLASS(2)
|
||||
#define EVENT_CLASS_FILE EVENT_CLASS(3)
|
||||
|
||||
/*
|
||||
|
@@ -19,27 +19,32 @@
|
||||
#include <isc/boolean.h>
|
||||
#include <isc/memcluster.h>
|
||||
|
||||
typedef boolean_t (*heap_higher_priority_func)(void *, void *);
|
||||
typedef void (*heap_index_func)(void *, unsigned int);
|
||||
typedef void (*heap_for_each_func)(void *, void *);
|
||||
/*
|
||||
* The comparision function returns ISC_TRUE if the first argument has
|
||||
* higher priority than the second argument, and ISC_FALSE otherwise.
|
||||
*/
|
||||
typedef isc_boolean_t (*isc_heapcompare_t)(void *, void *);
|
||||
|
||||
typedef struct heap_context *heap_t;
|
||||
typedef void (*isc_heapindex_t)(void *, unsigned int);
|
||||
typedef void (*isc_heapaction_t)(void *, void *);
|
||||
|
||||
#define heap_create __heap_create
|
||||
#define heap_destroy __heap_destroy
|
||||
#define heap_insert __heap_insert
|
||||
#define heap_delete __heap_delete
|
||||
#define heap_increased __heap_increased
|
||||
#define heap_decreased __heap_decreased
|
||||
#define heap_element __heap_element
|
||||
#define heap_for_each __heap_for_each
|
||||
typedef struct isc_heap *isc_heap_t;
|
||||
|
||||
isc_result heap_create(mem_context_t, heap_higher_priority_func,
|
||||
heap_index_func, unsigned int, heap_t *);
|
||||
void heap_destroy(heap_t *);
|
||||
isc_result heap_insert(heap_t, void *);
|
||||
void heap_delete(heap_t, unsigned int);
|
||||
void heap_increased(heap_t, unsigned int);
|
||||
void heap_decreased(heap_t, unsigned int);
|
||||
void * heap_element(heap_t, unsigned int);
|
||||
void heap_for_each(heap_t, heap_for_each_func, void *);
|
||||
#define isc_heap_create __isc_heap_create
|
||||
#define isc_heap_destroy __isc_heap_destroy
|
||||
#define isc_heap_insert __isc_heap_insert
|
||||
#define isc_heap_delete __isc_heap_delete
|
||||
#define isc_heap_increased __isc_heap_increased
|
||||
#define isc_heap_decreased __isc_heap_decreased
|
||||
#define isc_heap_element __isc_heap_element
|
||||
#define isc_heap_foreach __isc_heap_foreach
|
||||
|
||||
isc_result isc_heap_create(mem_context_t, isc_heapcompare_t,
|
||||
isc_heapindex_t, unsigned int, isc_heap_t *);
|
||||
void isc_heap_destroy(isc_heap_t *);
|
||||
isc_result isc_heap_insert(isc_heap_t, void *);
|
||||
void isc_heap_delete(isc_heap_t, unsigned int);
|
||||
void isc_heap_increased(isc_heap_t, unsigned int);
|
||||
void isc_heap_decreased(isc_heap_t, unsigned int);
|
||||
void * isc_heap_element(isc_heap_t, unsigned int);
|
||||
void isc_heap_foreach(isc_heap_t, isc_heapaction_t, void *);
|
||||
|
@@ -30,7 +30,7 @@ typedef struct task_manager * task_manager_t;
|
||||
*/
|
||||
typedef int task_eventtype_t;
|
||||
|
||||
typedef boolean_t (*task_action_t)(task_t, task_event_t);
|
||||
typedef isc_boolean_t (*task_action_t)(task_t, task_event_t);
|
||||
|
||||
/*
|
||||
* This structure is public because "subclassing" it may be useful when
|
||||
@@ -64,14 +64,14 @@ void task_event_free(task_event_t *);
|
||||
*** Tasks.
|
||||
***/
|
||||
|
||||
boolean_t task_create(task_manager_t,
|
||||
isc_boolean_t task_create(task_manager_t,
|
||||
task_action_t,
|
||||
void *,
|
||||
unsigned int,
|
||||
task_t *);
|
||||
void task_attach(task_t, task_t *);
|
||||
void task_detach(task_t *);
|
||||
boolean_t task_send_event(task_t,
|
||||
isc_boolean_t task_send_event(task_t,
|
||||
task_event_t *);
|
||||
void task_purge_events(task_t, void *,
|
||||
task_eventtype_t);
|
||||
|
@@ -148,7 +148,7 @@ timer_reset(timer_t timer,
|
||||
timer_type_t type,
|
||||
os_time_t expires,
|
||||
os_time_t interval,
|
||||
boolean_t purge);
|
||||
isc_boolean_t purge);
|
||||
/*
|
||||
* Change the timer's type, expires, and interval values to the given
|
||||
* values. If 'purge' is TRUE, any pending events from this timer
|
||||
|
@@ -2,9 +2,9 @@
|
||||
#include <isc/condition.h>
|
||||
#include <errno.h>
|
||||
|
||||
boolean_t
|
||||
isc_boolean_t
|
||||
os_condition_waituntil(os_condition_t *c, os_mutex_t *m, os_time_t *t,
|
||||
boolean_t *timeout)
|
||||
isc_boolean_t *timeout)
|
||||
{
|
||||
int result;
|
||||
struct timespec ts;
|
||||
@@ -13,11 +13,11 @@ os_condition_waituntil(os_condition_t *c, os_mutex_t *m, os_time_t *t,
|
||||
ts.tv_nsec = t->nanoseconds;
|
||||
result = pthread_cond_timedwait(c, m, &ts);
|
||||
if (result == 0) {
|
||||
*timeout = FALSE;
|
||||
return (TRUE);
|
||||
*timeout = ISC_FALSE;
|
||||
return (ISC_TRUE);
|
||||
} else if (result == ETIMEDOUT) {
|
||||
*timeout = TRUE;
|
||||
return (TRUE);
|
||||
*timeout = ISC_TRUE;
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
return (FALSE);
|
||||
return (ISC_FALSE);
|
||||
}
|
||||
|
@@ -17,9 +17,9 @@ typedef pthread_cond_t os_condition_t;
|
||||
#define os_condition_broadcast(cp) (pthread_cond_broadcast((cp)) == 0)
|
||||
#define os_condition_destroy(cp) (pthread_cond_destroy((cp)) == 0)
|
||||
|
||||
boolean_t os_condition_waituntil(os_condition_t *,
|
||||
isc_boolean_t os_condition_waituntil(os_condition_t *,
|
||||
os_mutex_t *,
|
||||
os_time_t *,
|
||||
boolean_t *);
|
||||
isc_boolean_t *);
|
||||
|
||||
#endif /* CONDITION_H */
|
||||
|
@@ -57,7 +57,7 @@ struct task {
|
||||
unsigned int references;
|
||||
task_eventlist_t events;
|
||||
unsigned int quantum;
|
||||
boolean_t enqueue_allowed;
|
||||
isc_boolean_t enqueue_allowed;
|
||||
task_event_t shutdown_event;
|
||||
/* Locked by task manager lock. */
|
||||
LINK(struct task) link;
|
||||
@@ -78,7 +78,7 @@ struct task_manager {
|
||||
LIST(struct task) tasks;
|
||||
LIST(struct task) ready_tasks;
|
||||
os_condition_t work_available;
|
||||
boolean_t exiting;
|
||||
isc_boolean_t exiting;
|
||||
unsigned int workers;
|
||||
os_condition_t no_workers;
|
||||
};
|
||||
@@ -167,7 +167,7 @@ task_free(task_t task) {
|
||||
mem_put(manager->mctx, task, sizeof *task);
|
||||
}
|
||||
|
||||
boolean_t
|
||||
isc_boolean_t
|
||||
task_create(task_manager_t manager, task_action_t shutdown_action,
|
||||
void *shutdown_arg, unsigned int quantum, task_t *taskp)
|
||||
{
|
||||
@@ -178,19 +178,19 @@ task_create(task_manager_t manager, task_action_t shutdown_action,
|
||||
|
||||
task = mem_get(manager->mctx, sizeof *task);
|
||||
if (task == NULL)
|
||||
return (FALSE);
|
||||
return (ISC_FALSE);
|
||||
|
||||
task->magic = TASK_MAGIC;
|
||||
task->manager = manager;
|
||||
if (!os_mutex_init(&task->lock)) {
|
||||
mem_put(manager->mctx, task, sizeof *task);
|
||||
return (FALSE);
|
||||
return (ISC_FALSE);
|
||||
}
|
||||
task->state = task_state_idle;
|
||||
task->references = 1;
|
||||
INIT_LIST(task->events);
|
||||
task->quantum = quantum;
|
||||
task->enqueue_allowed = TRUE;
|
||||
task->enqueue_allowed = ISC_TRUE;
|
||||
task->shutdown_event = event_allocate(manager->mctx,
|
||||
NULL,
|
||||
TASK_EVENT_SHUTDOWN,
|
||||
@@ -200,7 +200,7 @@ task_create(task_manager_t manager, task_action_t shutdown_action,
|
||||
if (task->shutdown_event == NULL) {
|
||||
(void)os_mutex_destroy(&task->lock);
|
||||
mem_put(manager->mctx, task, sizeof *task);
|
||||
return (FALSE);
|
||||
return (ISC_FALSE);
|
||||
}
|
||||
INIT_LINK(task, link);
|
||||
INIT_LINK(task, ready_link);
|
||||
@@ -213,7 +213,7 @@ task_create(task_manager_t manager, task_action_t shutdown_action,
|
||||
|
||||
*taskp = task;
|
||||
|
||||
return (TRUE);
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -231,7 +231,7 @@ task_attach(task_t task, task_t *taskp) {
|
||||
|
||||
void
|
||||
task_detach(task_t *taskp) {
|
||||
boolean_t free_task = FALSE;
|
||||
isc_boolean_t free_task = ISC_FALSE;
|
||||
task_t task;
|
||||
|
||||
XTRACE("task_detach");
|
||||
@@ -244,7 +244,7 @@ task_detach(task_t *taskp) {
|
||||
REQUIRE(task->references > 0);
|
||||
task->references--;
|
||||
if (task->state == task_state_shutdown && task->references == 0)
|
||||
free_task = TRUE;
|
||||
free_task = ISC_TRUE;
|
||||
UNLOCK(&task->lock);
|
||||
|
||||
if (free_task)
|
||||
@@ -253,10 +253,10 @@ task_detach(task_t *taskp) {
|
||||
*taskp = NULL;
|
||||
}
|
||||
|
||||
boolean_t
|
||||
isc_boolean_t
|
||||
task_send_event(task_t task, task_event_t *eventp) {
|
||||
boolean_t was_idle = FALSE;
|
||||
boolean_t discard = FALSE;
|
||||
isc_boolean_t was_idle = ISC_FALSE;
|
||||
isc_boolean_t discard = ISC_FALSE;
|
||||
task_event_t event;
|
||||
|
||||
REQUIRE(VALID_TASK(task));
|
||||
@@ -275,7 +275,7 @@ task_send_event(task_t task, task_event_t *eventp) {
|
||||
LOCK(&task->lock);
|
||||
if (task->enqueue_allowed) {
|
||||
if (task->state == task_state_idle) {
|
||||
was_idle = TRUE;
|
||||
was_idle = ISC_TRUE;
|
||||
INSIST(EMPTY(task->events));
|
||||
task->state = task_state_ready;
|
||||
}
|
||||
@@ -283,17 +283,17 @@ task_send_event(task_t task, task_event_t *eventp) {
|
||||
task->state == task_state_running);
|
||||
ENQUEUE(task->events, event, link);
|
||||
} else
|
||||
discard = TRUE;
|
||||
discard = ISC_TRUE;
|
||||
UNLOCK(&task->lock);
|
||||
|
||||
if (discard) {
|
||||
task_event_free(&event);
|
||||
*eventp = NULL;
|
||||
return (TRUE);
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
|
||||
if (was_idle) {
|
||||
boolean_t need_wakeup = FALSE;
|
||||
isc_boolean_t need_wakeup = ISC_FALSE;
|
||||
task_manager_t manager;
|
||||
|
||||
/*
|
||||
@@ -319,7 +319,7 @@ task_send_event(task_t task, task_event_t *eventp) {
|
||||
INSIST(VALID_MANAGER(manager));
|
||||
LOCK(&manager->lock);
|
||||
if (EMPTY(manager->ready_tasks))
|
||||
need_wakeup = TRUE;
|
||||
need_wakeup = ISC_TRUE;
|
||||
ENQUEUE(manager->ready_tasks, task, ready_link);
|
||||
UNLOCK(&manager->lock);
|
||||
|
||||
@@ -335,7 +335,7 @@ task_send_event(task_t task, task_event_t *eventp) {
|
||||
*eventp = NULL;
|
||||
|
||||
XTRACE("sent");
|
||||
return (TRUE);
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -377,8 +377,8 @@ task_purge_events(task_t task, void *sender, task_eventtype_t type) {
|
||||
|
||||
void
|
||||
task_shutdown(task_t task) {
|
||||
boolean_t was_idle = FALSE;
|
||||
boolean_t discard = FALSE;
|
||||
isc_boolean_t was_idle = ISC_FALSE;
|
||||
isc_boolean_t discard = ISC_FALSE;
|
||||
|
||||
REQUIRE(VALID_TASK(task));
|
||||
|
||||
@@ -389,7 +389,7 @@ task_shutdown(task_t task) {
|
||||
LOCK(&task->lock);
|
||||
if (task->enqueue_allowed) {
|
||||
if (task->state == task_state_idle) {
|
||||
was_idle = TRUE;
|
||||
was_idle = ISC_TRUE;
|
||||
INSIST(EMPTY(task->events));
|
||||
task->state = task_state_ready;
|
||||
}
|
||||
@@ -398,23 +398,23 @@ task_shutdown(task_t task) {
|
||||
INSIST(task->shutdown_event != NULL);
|
||||
ENQUEUE(task->events, task->shutdown_event, link);
|
||||
task->shutdown_event = NULL;
|
||||
task->enqueue_allowed = FALSE;
|
||||
task->enqueue_allowed = ISC_FALSE;
|
||||
} else
|
||||
discard = TRUE;
|
||||
discard = ISC_TRUE;
|
||||
UNLOCK(&task->lock);
|
||||
|
||||
if (discard)
|
||||
return;
|
||||
|
||||
if (was_idle) {
|
||||
boolean_t need_wakeup = FALSE;
|
||||
isc_boolean_t need_wakeup = ISC_FALSE;
|
||||
task_manager_t manager;
|
||||
|
||||
manager = task->manager;
|
||||
INSIST(VALID_MANAGER(manager));
|
||||
LOCK(&manager->lock);
|
||||
if (EMPTY(manager->ready_tasks))
|
||||
need_wakeup = TRUE;
|
||||
need_wakeup = ISC_TRUE;
|
||||
ENQUEUE(manager->ready_tasks, task, ready_link);
|
||||
UNLOCK(&manager->lock);
|
||||
|
||||
@@ -442,7 +442,7 @@ static
|
||||
void *task_manager_run(void *uap) {
|
||||
task_manager_t manager = uap;
|
||||
task_t task;
|
||||
boolean_t no_workers = FALSE;
|
||||
isc_boolean_t no_workers = ISC_FALSE;
|
||||
|
||||
XTRACE("start");
|
||||
|
||||
@@ -517,14 +517,14 @@ void *task_manager_run(void *uap) {
|
||||
task = HEAD(manager->ready_tasks);
|
||||
if (task != NULL) {
|
||||
unsigned int dispatch_count = 0;
|
||||
boolean_t done = FALSE;
|
||||
boolean_t requeue = FALSE;
|
||||
boolean_t wants_shutdown;
|
||||
boolean_t is_shutdown;
|
||||
boolean_t free_task = FALSE;
|
||||
isc_boolean_t done = ISC_FALSE;
|
||||
isc_boolean_t requeue = ISC_FALSE;
|
||||
isc_boolean_t wants_shutdown;
|
||||
isc_boolean_t is_shutdown;
|
||||
isc_boolean_t free_task = ISC_FALSE;
|
||||
task_event_t event;
|
||||
task_eventlist_t remaining_events;
|
||||
boolean_t discard_remaining = FALSE;
|
||||
isc_boolean_t discard_remaining = ISC_FALSE;
|
||||
|
||||
INSIST(VALID_TASK(task));
|
||||
|
||||
@@ -545,7 +545,7 @@ void *task_manager_run(void *uap) {
|
||||
* Put the task to sleep.
|
||||
*/
|
||||
task->state = task_state_idle;
|
||||
done = TRUE;
|
||||
done = ISC_TRUE;
|
||||
XTRACE("ready but empty");
|
||||
} else
|
||||
task->state = task_state_running;
|
||||
@@ -556,9 +556,9 @@ void *task_manager_run(void *uap) {
|
||||
UNLOCK(&task->lock);
|
||||
|
||||
if (event->type == TASK_EVENT_SHUTDOWN)
|
||||
is_shutdown = TRUE;
|
||||
is_shutdown = ISC_TRUE;
|
||||
else
|
||||
is_shutdown = FALSE;
|
||||
is_shutdown = ISC_FALSE;
|
||||
|
||||
/*
|
||||
* Execute the event action.
|
||||
@@ -568,7 +568,7 @@ void *task_manager_run(void *uap) {
|
||||
wants_shutdown =
|
||||
(event->action)(task, event);
|
||||
else
|
||||
wants_shutdown = FALSE;
|
||||
wants_shutdown = ISC_FALSE;
|
||||
dispatch_count++;
|
||||
|
||||
task_event_free(&event);
|
||||
@@ -592,13 +592,13 @@ void *task_manager_run(void *uap) {
|
||||
remaining_events =
|
||||
task->events;
|
||||
INIT_LIST(task->events);
|
||||
discard_remaining = TRUE;
|
||||
discard_remaining = ISC_TRUE;
|
||||
}
|
||||
if (task->references == 0)
|
||||
free_task = TRUE;
|
||||
free_task = ISC_TRUE;
|
||||
task->state = task_state_shutdown;
|
||||
task->enqueue_allowed = FALSE;
|
||||
done = TRUE;
|
||||
task->enqueue_allowed = ISC_FALSE;
|
||||
done = ISC_TRUE;
|
||||
} else if (EMPTY(task->events)) {
|
||||
/*
|
||||
* Nothing else to do for this task.
|
||||
@@ -609,7 +609,7 @@ void *task_manager_run(void *uap) {
|
||||
*/
|
||||
XTRACE("empty");
|
||||
task->state = task_state_idle;
|
||||
done = TRUE;
|
||||
done = ISC_TRUE;
|
||||
} else if (dispatch_count >= task->quantum) {
|
||||
/*
|
||||
* Our quantum has expired, but
|
||||
@@ -623,8 +623,8 @@ void *task_manager_run(void *uap) {
|
||||
*/
|
||||
XTRACE("quantum");
|
||||
task->state = task_state_ready;
|
||||
requeue = TRUE;
|
||||
done = TRUE;
|
||||
requeue = ISC_TRUE;
|
||||
done = ISC_TRUE;
|
||||
}
|
||||
}
|
||||
UNLOCK(&task->lock);
|
||||
@@ -672,7 +672,7 @@ void *task_manager_run(void *uap) {
|
||||
INSIST(manager->workers > 0);
|
||||
manager->workers--;
|
||||
if (manager->workers == 0)
|
||||
no_workers = TRUE;
|
||||
no_workers = ISC_TRUE;
|
||||
UNLOCK(&manager->lock);
|
||||
|
||||
if (no_workers)
|
||||
@@ -721,7 +721,7 @@ task_manager_create(mem_context_t mctx, unsigned int workers,
|
||||
mem_put(mctx, manager, sizeof *manager);
|
||||
return (0);
|
||||
}
|
||||
manager->exiting = FALSE;
|
||||
manager->exiting = ISC_FALSE;
|
||||
manager->workers = 0;
|
||||
if (!os_condition_init(&manager->no_workers)) {
|
||||
(void)os_condition_destroy(&manager->work_available);
|
||||
@@ -786,7 +786,7 @@ task_manager_destroy(task_manager_t *managerp) {
|
||||
* Make sure we only get called once.
|
||||
*/
|
||||
INSIST(!manager->exiting);
|
||||
manager->exiting = TRUE;
|
||||
manager->exiting = ISC_TRUE;
|
||||
|
||||
/*
|
||||
* Post the shutdown event to every task (if it hasn't already been
|
||||
@@ -807,7 +807,7 @@ task_manager_destroy(task_manager_t *managerp) {
|
||||
}
|
||||
INSIST(task->state == task_state_ready ||
|
||||
task->state == task_state_running);
|
||||
task->enqueue_allowed = FALSE;
|
||||
task->enqueue_allowed = ISC_FALSE;
|
||||
}
|
||||
UNLOCK(&task->lock);
|
||||
}
|
||||
|
@@ -74,17 +74,17 @@ struct timer_manager_t {
|
||||
mem_context_t mctx;
|
||||
os_mutex_t lock;
|
||||
/* Locked by manager lock. */
|
||||
boolean_t done;
|
||||
isc_boolean_t done;
|
||||
LIST(struct timer_t) timers;
|
||||
unsigned int nscheduled;
|
||||
os_time_t due;
|
||||
os_condition_t wakeup;
|
||||
os_thread_t thread;
|
||||
heap_t heap;
|
||||
isc_heap_t heap;
|
||||
};
|
||||
|
||||
static inline isc_result
|
||||
schedule(timer_t timer, os_time_t *nowp, boolean_t broadcast_ok) {
|
||||
schedule(timer_t timer, os_time_t *nowp, isc_boolean_t broadcast_ok) {
|
||||
isc_result result;
|
||||
timer_manager_t manager;
|
||||
os_time_t due;
|
||||
@@ -122,10 +122,10 @@ schedule(timer_t timer, os_time_t *nowp, boolean_t broadcast_ok) {
|
||||
timer->due = due;
|
||||
switch (cmp) {
|
||||
case -1:
|
||||
heap_increased(manager->heap, timer->index);
|
||||
isc_heap_increased(manager->heap, timer->index);
|
||||
break;
|
||||
case 1:
|
||||
heap_decreased(manager->heap, timer->index);
|
||||
isc_heap_decreased(manager->heap, timer->index);
|
||||
break;
|
||||
case 0:
|
||||
/* Nothing to do. */
|
||||
@@ -133,7 +133,7 @@ schedule(timer_t timer, os_time_t *nowp, boolean_t broadcast_ok) {
|
||||
}
|
||||
} else {
|
||||
timer->due = due;
|
||||
result = heap_insert(manager->heap, timer);
|
||||
result = isc_heap_insert(manager->heap, timer);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
INSIST(result == ISC_R_NOMEMORY);
|
||||
return (ISC_R_NOMEMORY);
|
||||
@@ -159,7 +159,7 @@ schedule(timer_t timer, os_time_t *nowp, boolean_t broadcast_ok) {
|
||||
|
||||
static inline void
|
||||
deschedule(timer_t timer) {
|
||||
boolean_t need_wakeup = FALSE;
|
||||
isc_boolean_t need_wakeup = ISC_FALSE;
|
||||
timer_manager_t manager;
|
||||
|
||||
/*
|
||||
@@ -169,8 +169,8 @@ deschedule(timer_t timer) {
|
||||
manager = timer->manager;
|
||||
if (timer->index > 0) {
|
||||
if (timer->index == 1)
|
||||
need_wakeup = TRUE;
|
||||
heap_delete(manager->heap, timer->index);
|
||||
need_wakeup = ISC_TRUE;
|
||||
isc_heap_delete(manager->heap, timer->index);
|
||||
timer->index = 0;
|
||||
INSIST(manager->nscheduled > 0);
|
||||
manager->nscheduled--;
|
||||
@@ -231,7 +231,7 @@ timer_create(timer_manager_t manager, timer_type_t type,
|
||||
*/
|
||||
result = os_time_get(&now);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
unexpected_error(__FILE__, __LINE__,
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"os_time_get() failed: %s",
|
||||
isc_result_to_text(result));
|
||||
return (ISC_R_UNEXPECTED);
|
||||
@@ -260,7 +260,7 @@ timer_create(timer_manager_t manager, timer_type_t type,
|
||||
timer->index = 0;
|
||||
if (!os_mutex_init(&timer->lock)) {
|
||||
mem_put(manager->mctx, timer, sizeof *timer);
|
||||
unexpected_error(__FILE__, __LINE__, "os_mutex_init() failed");
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__, "os_mutex_init() failed");
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ timer_create(timer_manager_t manager, timer_type_t type,
|
||||
*/
|
||||
|
||||
APPEND(manager->timers, timer, link);
|
||||
result = schedule(timer, &now, TRUE);
|
||||
result = schedule(timer, &now, ISC_TRUE);
|
||||
|
||||
UNLOCK(&manager->lock);
|
||||
|
||||
@@ -284,7 +284,7 @@ timer_create(timer_manager_t manager, timer_type_t type,
|
||||
|
||||
isc_result
|
||||
timer_reset(timer_t timer, timer_type_t type,
|
||||
os_time_t expires, os_time_t interval, boolean_t purge)
|
||||
os_time_t expires, os_time_t interval, isc_boolean_t purge)
|
||||
{
|
||||
os_time_t now;
|
||||
timer_manager_t manager;
|
||||
@@ -292,7 +292,7 @@ timer_reset(timer_t timer, timer_type_t type,
|
||||
|
||||
/*
|
||||
* Change the timer's type, expires, and interval values to the given
|
||||
* values. If 'purge' is TRUE, any pending events from this timer
|
||||
* values. If 'purge' is ISC_TRUE, any pending events from this timer
|
||||
* are purged from its task's event queue.
|
||||
*/
|
||||
|
||||
@@ -306,7 +306,7 @@ timer_reset(timer_t timer, timer_type_t type,
|
||||
*/
|
||||
result = os_time_get(&now);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
unexpected_error(__FILE__, __LINE__,
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"os_time_get() failed: %s",
|
||||
isc_result_to_text(result));
|
||||
return (ISC_R_UNEXPECTED);
|
||||
@@ -328,7 +328,7 @@ timer_reset(timer_t timer, timer_type_t type,
|
||||
timer->idle.seconds = 0;
|
||||
timer->idle.nanoseconds = 0;
|
||||
}
|
||||
result = schedule(timer, &now, TRUE);
|
||||
result = schedule(timer, &now, ISC_TRUE);
|
||||
|
||||
UNLOCK(&timer->lock);
|
||||
UNLOCK(&manager->lock);
|
||||
@@ -353,7 +353,7 @@ timer_touch(timer_t timer) {
|
||||
|
||||
result = os_time_get(&now);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
unexpected_error(__FILE__, __LINE__,
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"os_time_get() failed: %s",
|
||||
isc_result_to_text(result));
|
||||
return (ISC_R_UNEXPECTED);
|
||||
@@ -384,7 +384,7 @@ timer_attach(timer_t timer, timer_t *timerp) {
|
||||
void
|
||||
timer_detach(timer_t *timerp) {
|
||||
timer_t timer;
|
||||
boolean_t free_timer = FALSE;
|
||||
isc_boolean_t free_timer = ISC_FALSE;
|
||||
|
||||
/*
|
||||
* Detach *timerp from its timer.
|
||||
@@ -398,7 +398,7 @@ timer_detach(timer_t *timerp) {
|
||||
REQUIRE(timer->references > 0);
|
||||
timer->references--;
|
||||
if (timer->references == 0)
|
||||
free_timer = TRUE;
|
||||
free_timer = ISC_TRUE;
|
||||
UNLOCK(&timer->lock);
|
||||
|
||||
if (free_timer)
|
||||
@@ -409,38 +409,38 @@ timer_detach(timer_t *timerp) {
|
||||
|
||||
static void
|
||||
dispatch(timer_manager_t manager, os_time_t *nowp) {
|
||||
boolean_t done = FALSE, post_event, need_schedule;
|
||||
isc_boolean_t done = ISC_FALSE, post_event, need_schedule;
|
||||
task_event_t event;
|
||||
task_eventtype_t type = 0;
|
||||
timer_t timer;
|
||||
isc_result result;
|
||||
|
||||
while (manager->nscheduled > 0 && !done) {
|
||||
timer = heap_element(manager->heap, 1);
|
||||
timer = isc_heap_element(manager->heap, 1);
|
||||
if (os_time_compare(nowp, &timer->due) >= 0) {
|
||||
if (timer->type == timer_type_ticker) {
|
||||
type = TIMER_EVENT_TICK;
|
||||
post_event = TRUE;
|
||||
need_schedule = TRUE;
|
||||
post_event = ISC_TRUE;
|
||||
need_schedule = ISC_TRUE;
|
||||
} else if (!ZERO(timer->expires) &&
|
||||
os_time_compare(nowp,
|
||||
&timer->expires) >= 0) {
|
||||
type = TIMER_EVENT_LIFE;
|
||||
post_event = TRUE;
|
||||
need_schedule = FALSE;
|
||||
post_event = ISC_TRUE;
|
||||
need_schedule = ISC_FALSE;
|
||||
} else if (!ZERO(timer->idle) &&
|
||||
os_time_compare(nowp,
|
||||
&timer->idle) >= 0) {
|
||||
type = TIMER_EVENT_IDLE;
|
||||
post_event = TRUE;
|
||||
need_schedule = FALSE;
|
||||
post_event = ISC_TRUE;
|
||||
need_schedule = ISC_FALSE;
|
||||
} else {
|
||||
/*
|
||||
* Idle timer has been touched; reschedule.
|
||||
*/
|
||||
XTRACEID("idle reschedule", timer);
|
||||
post_event = FALSE;
|
||||
need_schedule = TRUE;
|
||||
post_event = ISC_FALSE;
|
||||
need_schedule = ISC_TRUE;
|
||||
}
|
||||
|
||||
if (post_event) {
|
||||
@@ -456,24 +456,24 @@ dispatch(timer_manager_t manager, os_time_t *nowp) {
|
||||
INSIST(task_send_event(timer->task,
|
||||
&event));
|
||||
else
|
||||
unexpected_error(__FILE__, __LINE__,
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"couldn't allocate event");
|
||||
}
|
||||
|
||||
timer->index = 0;
|
||||
heap_delete(manager->heap, 1);
|
||||
isc_heap_delete(manager->heap, 1);
|
||||
manager->nscheduled--;
|
||||
|
||||
if (need_schedule) {
|
||||
result = schedule(timer, nowp, FALSE);
|
||||
result = schedule(timer, nowp, ISC_FALSE);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
unexpected_error(__FILE__, __LINE__,
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"couldn't schedule timer: %s",
|
||||
result);
|
||||
}
|
||||
} else {
|
||||
manager->due = timer->due;
|
||||
done = TRUE;
|
||||
done = ISC_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -481,7 +481,7 @@ dispatch(timer_manager_t manager, os_time_t *nowp) {
|
||||
static void *
|
||||
run(void *uap) {
|
||||
timer_manager_t manager = uap;
|
||||
boolean_t timeout;
|
||||
isc_boolean_t timeout;
|
||||
os_time_t now;
|
||||
|
||||
LOCK(&manager->lock);
|
||||
@@ -507,7 +507,7 @@ run(void *uap) {
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static boolean_t
|
||||
static isc_boolean_t
|
||||
sooner(void *v1, void *v2) {
|
||||
timer_t t1, t2;
|
||||
|
||||
@@ -517,8 +517,8 @@ sooner(void *v1, void *v2) {
|
||||
REQUIRE(VALID_TIMER(t2));
|
||||
|
||||
if (os_time_compare(&t1->due, &t2->due) < 0)
|
||||
return (TRUE);
|
||||
return (FALSE);
|
||||
return (ISC_TRUE);
|
||||
return (ISC_FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -548,38 +548,38 @@ timer_manager_create(mem_context_t mctx, timer_manager_t *managerp) {
|
||||
|
||||
manager->magic = TIMER_MANAGER_MAGIC;
|
||||
manager->mctx = mctx;
|
||||
manager->done = FALSE;
|
||||
manager->done = ISC_FALSE;
|
||||
INIT_LIST(manager->timers);
|
||||
manager->nscheduled = 0;
|
||||
manager->due.seconds = 0;
|
||||
manager->due.nanoseconds = 0;
|
||||
manager->heap = NULL;
|
||||
result = heap_create(mctx, sooner, set_index, 0, &manager->heap);
|
||||
result = isc_heap_create(mctx, sooner, set_index, 0, &manager->heap);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
INSIST(result == ISC_R_NOMEMORY);
|
||||
mem_put(mctx, manager, sizeof *manager);
|
||||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
if (!os_mutex_init(&manager->lock)) {
|
||||
heap_destroy(&manager->heap);
|
||||
isc_heap_destroy(&manager->heap);
|
||||
mem_put(mctx, manager, sizeof *manager);
|
||||
unexpected_error(__FILE__, __LINE__, "os_mutex_init() failed");
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__, "os_mutex_init() failed");
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
if (!os_condition_init(&manager->wakeup)) {
|
||||
(void)os_mutex_destroy(&manager->lock);
|
||||
heap_destroy(&manager->heap);
|
||||
isc_heap_destroy(&manager->heap);
|
||||
mem_put(mctx, manager, sizeof *manager);
|
||||
unexpected_error(__FILE__, __LINE__,
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"os_condition_init() failed");
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
if (!os_thread_create(run, manager, &manager->thread)) {
|
||||
(void)os_condition_destroy(&manager->wakeup);
|
||||
(void)os_mutex_destroy(&manager->lock);
|
||||
heap_destroy(&manager->heap);
|
||||
isc_heap_destroy(&manager->heap);
|
||||
mem_put(mctx, manager, sizeof *manager);
|
||||
unexpected_error(__FILE__, __LINE__,
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"os_thread_create() failed");
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
@@ -604,7 +604,7 @@ timer_manager_destroy(timer_manager_t *managerp) {
|
||||
LOCK(&manager->lock);
|
||||
|
||||
REQUIRE(EMPTY(manager->timers));
|
||||
manager->done = TRUE;
|
||||
manager->done = ISC_TRUE;
|
||||
|
||||
UNLOCK(&manager->lock);
|
||||
|
||||
@@ -615,7 +615,7 @@ timer_manager_destroy(timer_manager_t *managerp) {
|
||||
* Wait for thread to exit.
|
||||
*/
|
||||
if (!os_thread_join(manager->thread))
|
||||
unexpected_error(__FILE__, __LINE__,
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"os_thread_join() failed");
|
||||
|
||||
/*
|
||||
@@ -623,7 +623,7 @@ timer_manager_destroy(timer_manager_t *managerp) {
|
||||
*/
|
||||
(void)os_condition_destroy(&manager->wakeup);
|
||||
(void)os_mutex_destroy(&manager->lock);
|
||||
heap_destroy(&manager->heap);
|
||||
isc_heap_destroy(&manager->heap);
|
||||
manager->magic = 0;
|
||||
mem_put(manager->mctx, manager, sizeof *manager);
|
||||
|
||||
|
@@ -22,7 +22,7 @@ os_time_get(os_time_t *timep) {
|
||||
REQUIRE(timep != NULL);
|
||||
|
||||
if (gettimeofday(&tv, NULL) == -1) {
|
||||
unexpected_error(__FILE__, __LINE__, strerror(errno));
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__, strerror(errno));
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user