summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib/isc/task.c
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2007-12-09 13:39:46 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2007-12-09 13:39:46 +0000
commit1173d5eff8dc423c129f442023419436ee94db23 (patch)
tree57c2bcdc1429b2e80b91a387cd1dc561dab988eb /usr.sbin/bind/lib/isc/task.c
parente4a92ccc5f8c866478b32a346c71150a2cdf5001 (diff)
resolve conflicts
Diffstat (limited to 'usr.sbin/bind/lib/isc/task.c')
-rw-r--r--usr.sbin/bind/lib/isc/task.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/usr.sbin/bind/lib/isc/task.c b/usr.sbin/bind/lib/isc/task.c
index ce0327067b6..efffd536323 100644
--- a/usr.sbin/bind/lib/isc/task.c
+++ b/usr.sbin/bind/lib/isc/task.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,10 +15,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: task.c,v 1.85.2.3.8.5 2004/10/15 00:45:45 marka Exp $ */
+/* $ISC: task.c,v 1.91.18.6 2006/01/04 23:50:23 marka Exp $ */
-/*
- * Principal Author: Bob Halley
+/*! \file
+ * \author Principal Author: Bob Halley
*/
/*
@@ -174,6 +174,7 @@ isc_task_create(isc_taskmgr_t *manager, unsigned int quantum,
{
isc_task_t *task;
isc_boolean_t exiting;
+ isc_result_t result;
REQUIRE(VALID_MANAGER(manager));
REQUIRE(taskp != NULL && *taskp == NULL);
@@ -183,13 +184,10 @@ isc_task_create(isc_taskmgr_t *manager, unsigned int quantum,
return (ISC_R_NOMEMORY);
XTRACE("isc_task_create");
task->manager = manager;
- if (isc_mutex_init(&task->lock) != ISC_R_SUCCESS) {
+ result = isc_mutex_init(&task->lock);
+ if (result != ISC_R_SUCCESS) {
isc_mem_put(manager->mctx, task, sizeof(*task));
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "isc_mutex_init() %s",
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED, "failed"));
- return (ISC_R_UNEXPECTED);
+ return (result);
}
task->state = task_state_idle;
task->references = 1;
@@ -1066,14 +1064,10 @@ isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers,
return (ISC_R_NOMEMORY);
manager->magic = TASK_MANAGER_MAGIC;
manager->mctx = NULL;
- if (isc_mutex_init(&manager->lock) != ISC_R_SUCCESS) {
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "isc_mutex_init() %s",
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED, "failed"));
- result = ISC_R_UNEXPECTED;
+ result = isc_mutex_init(&manager->lock);
+ if (result != ISC_R_SUCCESS)
goto cleanup_mgr;
- }
+
#ifdef ISC_PLATFORM_USETHREADS
manager->workers = 0;
manager->threads = isc_mem_allocate(mctx,
@@ -1235,6 +1229,8 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp) {
UNLOCK(&manager->lock);
while (isc__taskmgr_ready())
(void)isc__taskmgr_dispatch();
+ if (!ISC_LIST_EMPTY(manager->tasks))
+ isc_mem_printallactive(stderr);
INSIST(ISC_LIST_EMPTY(manager->tasks));
#endif /* ISC_PLATFORM_USETHREADS */