summaryrefslogtreecommitdiff
path: root/external/mpl/bind/dist/lib/isc/tests/timer_test.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2023-06-26 22:02:59 +0000
committerchristos <christos@NetBSD.org>2023-06-26 22:02:59 +0000
commita706c3b77df285fe88b974fb675975d899435aa3 (patch)
tree4d2014b5fba83365a4c1f3761d39fcbffa1e5163 /external/mpl/bind/dist/lib/isc/tests/timer_test.c
parent51f80bb2951ace01adfd5fe4138a3cee941ff3ea (diff)
merge conflicts between 9.16.37 and 9.16.42
Diffstat (limited to 'external/mpl/bind/dist/lib/isc/tests/timer_test.c')
-rw-r--r--external/mpl/bind/dist/lib/isc/tests/timer_test.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/external/mpl/bind/dist/lib/isc/tests/timer_test.c b/external/mpl/bind/dist/lib/isc/tests/timer_test.c
index be11e5c001d..b3e5a89b51a 100644
--- a/external/mpl/bind/dist/lib/isc/tests/timer_test.c
+++ b/external/mpl/bind/dist/lib/isc/tests/timer_test.c
@@ -1,4 +1,4 @@
-/* $NetBSD: timer_test.c,v 1.9 2022/09/23 12:15:34 christos Exp $ */
+/* $NetBSD: timer_test.c,v 1.10 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -246,14 +246,14 @@ ticktock(isc_task_t *task, isc_event_t *event) {
isc_mutex_unlock(&lasttime_mx);
subthread_assert_result_equal(result, ISC_R_SUCCESS);
+ isc_event_free(&event);
+
if (atomic_load(&eventcnt) == nevents) {
result = isc_time_now(&endtime);
subthread_assert_result_equal(result, ISC_R_SUCCESS);
- isc_timer_detach(&timer);
+ isc_timer_destroy(&timer);
isc_task_shutdown(task);
}
-
- isc_event_free(&event);
}
/*
@@ -341,9 +341,10 @@ test_idle(isc_task_t *task, isc_event_t *event) {
subthread_assert_int_equal(event->ev_type, ISC_TIMEREVENT_IDLE);
- isc_timer_detach(&timer);
- isc_task_shutdown(task);
isc_event_free(&event);
+
+ isc_timer_destroy(&timer);
+ isc_task_shutdown(task);
}
/* timer type once idles out */
@@ -428,14 +429,15 @@ test_reset(isc_task_t *task, isc_event_t *event) {
&expires, &interval, false);
subthread_assert_result_equal(result, ISC_R_SUCCESS);
}
+
+ isc_event_free(&event);
} else {
subthread_assert_int_equal(event->ev_type, ISC_TIMEREVENT_LIFE);
- isc_timer_detach(&timer);
+ isc_event_free(&event);
+ isc_timer_destroy(&timer);
isc_task_shutdown(task);
}
-
- isc_event_free(&event);
}
static void
@@ -593,8 +595,8 @@ purge(void **state) {
assert_int_equal(atomic_load(&eventcnt), 1);
- isc_timer_detach(&tickertimer);
- isc_timer_detach(&oncetimer);
+ isc_timer_destroy(&tickertimer);
+ isc_timer_destroy(&oncetimer);
isc_task_destroy(&task1);
isc_task_destroy(&task2);
}