Commit 738b9aa3 authored by Bob Halley's avatar Bob Halley
Browse files

isc_task_create() API change

parent 0e9c5d24
......@@ -328,7 +328,7 @@ main(int argc, char **argv)
NULL, NULL);
ISC_LIST_INIT(cmgr[i].idle);
ISC_LIST_INIT(cmgr[i].running);
result = isc_task_create(taskmgr, mem, 0, &cmgr[i].task);
result = isc_task_create(taskmgr, 0, &cmgr[i].task);
if (result != ISC_R_SUCCESS)
break;
isc_task_setname(cmgr[i].task, "lwresd client", &cmgr[i]);
......
......@@ -1112,8 +1112,7 @@ client_create(ns_clientmgr_t *manager, ns_client_t **clientp)
return (ISC_R_NOMEMORY);
client->task = NULL;
result = isc_task_create(manager->taskmgr, manager->mctx, 0,
&client->task);
result = isc_task_create(manager->taskmgr, 0, &client->task);
if (result != ISC_R_SUCCESS)
goto cleanup_client;
isc_task_setname(client->task, "client", client);
......
......@@ -221,7 +221,7 @@ ns_interface_create(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr,
* Create a task.
*/
ifp->task = NULL;
result = isc_task_create(mgr->taskmgr, mgr->mctx, 0, &ifp->task);
result = isc_task_create(mgr->taskmgr, 0, &ifp->task);
if (result != ISC_R_SUCCESS) {
isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_ERROR,
"isc_task_create() failed: %s",
......
......@@ -320,10 +320,10 @@ main(int argc, char **argv)
create_managers();
t1 = NULL;
result = isc_task_create(taskmgr, NULL, 0, &t1);
result = isc_task_create(taskmgr, 0, &t1);
check_result(result, "isc_task_create t1");
t2 = NULL;
result = isc_task_create(taskmgr, NULL, 0, &t2);
result = isc_task_create(taskmgr, 0, &t2);
check_result(result, "isc_task_create t2");
printf("task 1 = %p\n", t1);
......
......@@ -141,7 +141,7 @@ main(int argc, char *argv[]) {
RUNTIME_CHECK(isc_taskmgr_create(mctx, workers, 0, &taskmgr) ==
ISC_R_SUCCESS);
task = NULL;
RUNTIME_CHECK(isc_task_create(taskmgr, mctx, 0, &task) ==
RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task) ==
ISC_R_SUCCESS);
timermgr = NULL;
......
......@@ -268,7 +268,7 @@ main(int argc, char *argv[]) {
RUNTIME_CHECK(isc_taskmgr_create(mctx, workers, 0, &taskmgr) ==
ISC_R_SUCCESS);
task = NULL;
RUNTIME_CHECK(isc_task_create(taskmgr, mctx, 0, &task) ==
RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task) ==
ISC_R_SUCCESS);
timermgr = NULL;
......
......@@ -367,11 +367,11 @@ main(int argc, char *argv[])
ISC_R_SUCCESS);
t0 = NULL;
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t0) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t0) == ISC_R_SUCCESS);
t1 = NULL;
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t1) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t1) == ISC_R_SUCCESS);
t2 = NULL;
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t2) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t2) == ISC_R_SUCCESS);
socketmgr = NULL;
RUNTIME_CHECK(isc_socketmgr_create(mctx, &socketmgr) == ISC_R_SUCCESS);
......
......@@ -378,11 +378,11 @@ main(int argc, char *argv[])
ISC_R_SUCCESS);
t0 = NULL;
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t0) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t0) == ISC_R_SUCCESS);
t1 = NULL;
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t1) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t1) == ISC_R_SUCCESS);
t2 = NULL;
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t2) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t2) == ISC_R_SUCCESS);
socketmgr = NULL;
RUNTIME_CHECK(isc_socketmgr_create(mctx, &socketmgr) == ISC_R_SUCCESS);
......
......@@ -72,7 +72,7 @@ main(int argc, char *argv[]) {
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_timermgr_create(mctx, &timermgr) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(taskmgr, mctx, 0, &task) ==
RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_ratelimiter_create(mctx, timermgr, task,
......
......@@ -177,10 +177,10 @@ main(int argc, char *argv[]) {
RUNTIME_CHECK(isc_taskmgr_create(mctx, workers, 0, &taskmgr) ==
ISC_R_SUCCESS);
task1 = NULL;
RUNTIME_CHECK(isc_task_create(taskmgr, mctx, 0, &task1) ==
RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task1) ==
ISC_R_SUCCESS);
task2 = NULL;
RUNTIME_CHECK(isc_task_create(taskmgr, mctx, 0, &task2) ==
RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task2) ==
ISC_R_SUCCESS);
timermgr = NULL;
RUNTIME_CHECK(isc_timermgr_create(mctx, &timermgr) == ISC_R_SUCCESS);
......
......@@ -265,7 +265,7 @@ main(int argc, char *argv[]) {
result = isc_taskmgr_create(mctx, 1, 0, &taskmgr);
check_result(result, "isc_taskmgr_create()");
task = NULL;
result = isc_task_create(taskmgr, NULL, 0, &task);
result = isc_task_create(taskmgr, 0, &task);
check_result(result, "isc_task_create()");
socketmgr = NULL;
result = isc_socketmgr_create(mctx, &socketmgr);
......
......@@ -154,7 +154,7 @@ new_task(isc_mem_t *mctx, char *name) {
strcpy(ti->name, name);
} else
sprintf(ti->name, "%d", task_count);
RUNTIME_CHECK(isc_task_create(task_manager, mctx, 0, &ti->task) ==
RUNTIME_CHECK(isc_task_create(task_manager, 0, &ti->task) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_onshutdown(ti->task, shutdown_action, ti) ==
ISC_R_SUCCESS);
......@@ -209,14 +209,14 @@ main(int argc, char *argv[]) {
* Test implicit shutdown.
*/
task = NULL;
RUNTIME_CHECK(isc_task_create(task_manager, mctx, 0, &task) ==
RUNTIME_CHECK(isc_task_create(task_manager, 0, &task) ==
ISC_R_SUCCESS);
isc_task_detach(&task);
/*
* Test anti-zombie code.
*/
RUNTIME_CHECK(isc_task_create(task_manager, mctx, 0, &task) ==
RUNTIME_CHECK(isc_task_create(task_manager, 0, &task) ==
ISC_R_SUCCESS);
isc_task_detach(&task);
......
......@@ -223,7 +223,7 @@ my_listen(isc_task_t *task, isc_event_t *event)
* recv on it.
*/
newtask = NULL;
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &newtask)
RUNTIME_CHECK(isc_task_create(manager, 0, &newtask)
== ISC_R_SUCCESS);
isc_socket_recv(dev->newsocket, &region, 1,
newtask, my_recv, event->arg);
......@@ -302,9 +302,9 @@ main(int argc, char *argv[])
RUNTIME_CHECK(isc_timermgr_create(mctx, &timgr) == ISC_R_SUCCESS);
t1 = NULL;
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t1) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t1) == ISC_R_SUCCESS);
t2 = NULL;
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t2) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t2) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_onshutdown(t1, my_shutdown, "1") ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_onshutdown(t2, my_shutdown, "2") ==
......
......@@ -83,10 +83,10 @@ main(int argc, char *argv[]) {
RUNTIME_CHECK(isc_taskmgr_create(mctx, workers, 0, &manager) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t1) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t2) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t3) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, NULL, 0, &t4) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t1) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t2) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t3) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t4) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_onshutdown(t1, my_shutdown, "1") ==
ISC_R_SUCCESS);
......
......@@ -134,25 +134,25 @@ t_tasks1() {
return(T_FAIL);
}
isc_result = isc_task_create(manager, NULL, 0, &task1);
isc_result = isc_task_create(manager, 0, &task1);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %d\n", isc_result);
return(T_FAIL);
}
isc_result = isc_task_create(manager, NULL, 0, &task2);
isc_result = isc_task_create(manager, 0, &task2);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %d\n", isc_result);
return(T_FAIL);
}
isc_result = isc_task_create(manager, NULL, 0, &task3);
isc_result = isc_task_create(manager, 0, &task3);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %d\n", isc_result);
return(T_FAIL);
}
isc_result = isc_task_create(manager, NULL, 0, &task4);
isc_result = isc_task_create(manager, 0, &task4);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %d\n", isc_result);
return(T_FAIL);
......@@ -452,7 +452,7 @@ t2_callback(isc_task_t *task, isc_event_t *event)
/* create a new task and forward the message */
newtask = NULL;
isc_result = isc_task_create(T2_manager, NULL, 0, &newtask);
isc_result = isc_task_create(T2_manager, 0, &newtask);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %d\n", isc_result);
++T2_nfails;
......@@ -737,7 +737,7 @@ t_tasks3() {
}
task = NULL;
isc_result = isc_task_create(tmgr, mctx, 0, &task);
isc_result = isc_task_create(tmgr, 0, &task);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %s\n",
isc_result_totext(isc_result));
......@@ -953,7 +953,7 @@ t_tasks4() {
}
task = NULL;
isc_result = isc_task_create(tmgr, mctx, 0, &task);
isc_result = isc_task_create(tmgr, 0, &task);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %s\n",
isc_result_totext(isc_result));
......@@ -1151,7 +1151,7 @@ t_tasks7() {
}
task = NULL;
isc_result = isc_task_create(tmgr, mctx, 0, &task);
isc_result = isc_task_create(tmgr, 0, &task);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %s\n",
isc_result_totext(isc_result));
......@@ -1470,7 +1470,7 @@ t_taskpurge_x( int sender, int type, int tag,
}
task = NULL;
isc_result = isc_task_create(tmgr, mctx, 0, &task);
isc_result = isc_task_create(tmgr, 0, &task);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %s\n",
isc_result_totext(isc_result));
......@@ -1845,7 +1845,7 @@ t_tasks11(int purgable) {
}
task = NULL;
isc_result = isc_task_create(tmgr, mctx, 0, &task);
isc_result = isc_task_create(tmgr, 0, &task);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %s\n",
isc_result_totext(isc_result));
......
......@@ -112,17 +112,15 @@ main(int argc, char *argv[]) {
printf("%d workers\n", workers);
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx1) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx2) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx3) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_taskmgr_create(mctx1, workers, 0, &manager) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_timermgr_create(mctx1, &timgr) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, mctx1, 0, &t1) ==
RUNTIME_CHECK(isc_task_create(manager, 0, &t1) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, mctx2, 0, &t2) ==
RUNTIME_CHECK(isc_task_create(manager, 0, &t2) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, mctx3, 0, &t3) ==
RUNTIME_CHECK(isc_task_create(manager, 0, &t3) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_onshutdown(t1, shutdown_task, "1") ==
ISC_R_SUCCESS);
......@@ -171,12 +169,6 @@ main(int argc, char *argv[]) {
printf("Statistics for mctx1:\n");
isc_mem_stats(mctx1, stdout);
isc_mem_destroy(&mctx1);
printf("Statistics for mctx2:\n");
isc_mem_stats(mctx2, stdout);
isc_mem_destroy(&mctx2);
printf("Statistics for mctx3:\n");
isc_mem_stats(mctx3, stdout);
isc_mem_destroy(&mctx3);
return (0);
}
......@@ -239,7 +239,7 @@ t_timers_x(isc_timertype_t timertype, isc_time_t *expires,
}
task = NULL;
isc_result = isc_task_create(tmgr, mctx, 0, &task);
isc_result = isc_task_create(tmgr, 0, &task);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %s\n",
isc_result_totext(isc_result));
......@@ -841,7 +841,7 @@ t_timers5() {
}
T5_task1 = NULL;
isc_result = isc_task_create(tmgr, mctx, 0, &T5_task1);
isc_result = isc_task_create(tmgr, 0, &T5_task1);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %s\n",
isc_result_totext(isc_result));
......@@ -867,7 +867,7 @@ t_timers5() {
}
T5_task2 = NULL;
isc_result = isc_task_create(tmgr, mctx, 0, &T5_task2);
isc_result = isc_task_create(tmgr, 0, &T5_task2);
if (isc_result != ISC_R_SUCCESS) {
t_info("isc_task_create failed %s\n",
isc_result_totext(isc_result));
......
......@@ -345,10 +345,10 @@ main(int argc, char *argv[]) {
RUNTIME_CHECK(isc_taskmgr_create(mctx, workers, 0, &taskmgr) ==
ISC_R_SUCCESS);
task1 = NULL;
RUNTIME_CHECK(isc_task_create(taskmgr, mctx, 0, &task1) ==
RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task1) ==
ISC_R_SUCCESS);
task2 = NULL;
RUNTIME_CHECK(isc_task_create(taskmgr, mctx, 0, &task2) ==
RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task2) ==
ISC_R_SUCCESS);
timermgr = NULL;
RUNTIME_CHECK(isc_timermgr_create(mctx, &timermgr) == ISC_R_SUCCESS);
......
......@@ -2282,7 +2282,7 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
/*
* Allocate a timer and a task for our periodic cleanup.
*/
result = isc_task_create(adb->taskmgr, adb->mctx, 0, &adb->task);
result = isc_task_create(adb->taskmgr, 0, &adb->task);
if (result != ISC_R_SUCCESS)
goto fail3;
isc_task_setname(adb->task, "ADB", adb);
......
......@@ -3769,8 +3769,7 @@ dns_resolver_create(dns_view_t *view,
if (result != ISC_R_SUCCESS)
goto cleanup_buckets;
res->buckets[i].task = NULL;
result = isc_task_create(taskmgr, view->mctx, 0,
&res->buckets[i].task);
result = isc_task_create(taskmgr, 0, &res->buckets[i].task);
if (result != ISC_R_SUCCESS) {
isc_mutex_destroy(&res->buckets[i].lock);
goto cleanup_buckets;
......
Markdown is supported
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