From 6d177496bbb19a069d8a5af9a28e31e43c591c09 Mon Sep 17 00:00:00 2001 From: Martin Nagy Date: Wed, 14 Jan 2009 13:41:28 +0100 Subject: Few small changes for semaphore.c and util.h. Add a ZERO_PTR() macro in util.h. semaphore_destroy() will now ignore NULL pointers. --- semaphore.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'semaphore.c') diff --git a/semaphore.c b/semaphore.c index 1f43652..33ae9f8 100644 --- a/semaphore.c +++ b/semaphore.c @@ -63,10 +63,11 @@ semaphore_init(semaphore_t *sem, int value) void semaphore_destroy(semaphore_t *sem) { - REQUIRE(sem != NULL); + if (sem == NULL) + return; - REQUIRE(isc_mutex_destroy(&sem->mutex) == ISC_R_SUCCESS); - REQUIRE(isc_condition_destroy(&sem->cond) == ISC_R_SUCCESS); + RUNTIME_CHECK(isc_mutex_destroy(&sem->mutex) == ISC_R_SUCCESS); + RUNTIME_CHECK(isc_condition_destroy(&sem->cond) == ISC_R_SUCCESS); } /* -- cgit