isc_event_free(&event);
}
+static char one[] = "1";
+static char two[] = "2";
+static char xso1[] = "so1";
+static char xso2[] = "so2";
+
int
main(int argc, char *argv[]) {
isc_task_t *t1, *t2;
RUNTIME_CHECK(isc_task_create(manager, 0, &t1) == ISC_R_SUCCESS);
t2 = NULL;
RUNTIME_CHECK(isc_task_create(manager, 0, &t2) == ISC_R_SUCCESS);
- RUNTIME_CHECK(isc_task_onshutdown(t1, my_shutdown, "1") ==
+ RUNTIME_CHECK(isc_task_onshutdown(t1, my_shutdown, one) ==
ISC_R_SUCCESS);
- RUNTIME_CHECK(isc_task_onshutdown(t2, my_shutdown, "2") ==
+ RUNTIME_CHECK(isc_task_onshutdown(t2, my_shutdown, two) ==
ISC_R_SUCCESS);
printf("task 1 = %p\n", t1);
/*
* Queue up the first accept event.
*/
- RUNTIME_CHECK(isc_socket_accept(so1, t1, my_listen, "so1")
+ RUNTIME_CHECK(isc_socket_accept(so1, t1, my_listen, xso1)
== ISC_R_SUCCESS);
isc_time_settoepoch(&expires);
isc_interval_set(&interval, 10, 0);
&so2) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_socket_connect(so2, &sockaddr, t2,
- my_connect, "so2") == ISC_R_SUCCESS);
+ my_connect, xso2) == ISC_R_SUCCESS);
/*
* Detaching these is safe, since the socket will attach to the
isc_event_free(&event);
}
+static char one[] = "1";
+static char two[] = "2";
+static char three[] = "3";
+static char four[] = "4";
+static char foo[] = "foo";
+static char bar[] = "bar";
+
int
main(int argc, char *argv[]) {
isc_taskmgr_t *manager = NULL;
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") ==
+ RUNTIME_CHECK(isc_task_onshutdown(t1, my_shutdown, one) ==
ISC_R_SUCCESS);
- RUNTIME_CHECK(isc_task_onshutdown(t2, my_shutdown, "2") ==
+ RUNTIME_CHECK(isc_task_onshutdown(t2, my_shutdown, two) ==
ISC_R_SUCCESS);
- RUNTIME_CHECK(isc_task_onshutdown(t3, my_shutdown, "3") ==
+ RUNTIME_CHECK(isc_task_onshutdown(t3, my_shutdown, three) ==
ISC_R_SUCCESS);
- RUNTIME_CHECK(isc_task_onshutdown(t4, my_shutdown, "4") ==
+ RUNTIME_CHECK(isc_task_onshutdown(t4, my_shutdown, four) ==
ISC_R_SUCCESS);
timgr = NULL;
isc_interval_set(&interval, 1, 0);
RUNTIME_CHECK(isc_timer_create(timgr, isc_timertype_ticker, NULL,
- &interval, t1, my_tick, "foo", &ti1) ==
+ &interval, t1, my_tick, foo, &ti1) ==
ISC_R_SUCCESS);
ti2 = NULL;
isc_interval_set(&interval, 1, 0);
RUNTIME_CHECK(isc_timer_create(timgr, isc_timertype_ticker, NULL,
- &interval, t2, my_tick, "bar", &ti2) ==
+ &interval, t2, my_tick, bar, &ti2) ==
ISC_R_SUCCESS);
printf("task 1 = %p\n", t1);
* structure (socket, timer, task, etc) but this is just a test
* program.
*/
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
sizeof(*event));
isc_task_send(t1, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
sizeof(*event));
isc_task_send(t1, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
sizeof(*event));
isc_task_send(t1, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
sizeof(*event));
isc_task_send(t1, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
sizeof(*event));
isc_task_send(t1, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
sizeof(*event));
isc_task_send(t1, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
sizeof(*event));
isc_task_send(t1, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
sizeof(*event));
isc_task_send(t1, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
sizeof(*event));
isc_task_send(t1, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "2",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, two,
sizeof(*event));
isc_task_send(t2, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "3",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, three,
sizeof(*event));
isc_task_send(t3, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "4",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, four,
sizeof(*event));
isc_task_send(t4, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "2",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, two,
sizeof(*event));
isc_task_send(t2, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "3",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, three,
sizeof(*event));
isc_task_send(t3, &event);
- event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "4",
+ event = isc_event_allocate(mctx, (void *)1, 1, my_callback, four,
sizeof(*event));
isc_task_send(t4, &event);
isc_task_purgerange(t3,
isc_task_shutdown(task);
}
+static char one[] = "1";
+static char two[] = "2";
+static char three[] = "3";
+
int
main(int argc, char *argv[]) {
isc_taskmgr_t *manager = NULL;
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(manager, 0, &t3) ==
ISC_R_SUCCESS);
- RUNTIME_CHECK(isc_task_onshutdown(t1, shutdown_task, "1") ==
+ RUNTIME_CHECK(isc_task_onshutdown(t1, shutdown_task, one) ==
ISC_R_SUCCESS);
- RUNTIME_CHECK(isc_task_onshutdown(t2, shutdown_task, "2") ==
+ RUNTIME_CHECK(isc_task_onshutdown(t2, shutdown_task, two) ==
ISC_R_SUCCESS);
- RUNTIME_CHECK(isc_task_onshutdown(t3, shutdown_task, "3") ==
+ RUNTIME_CHECK(isc_task_onshutdown(t3, shutdown_task, three) ==
ISC_R_SUCCESS);
printf("task 1: %p\n", t1);
isc_interval_set(&interval, 2, 0);
RUNTIME_CHECK(isc_timer_create(timgr, isc_timertype_once, NULL,
- &interval, t2, timeout, "2", &ti2) ==
+ &interval, t2, timeout, two, &ti2) ==
ISC_R_SUCCESS);
isc_interval_set(&interval, 1, 0);
RUNTIME_CHECK(isc_timer_create(timgr, isc_timertype_ticker, NULL,
- &interval, t1, tick, "1", &ti1) ==
+ &interval, t1, tick, one, &ti1) ==
ISC_R_SUCCESS);
isc_interval_set(&interval, 10, 0);
ISC_R_SUCCESS);
isc_interval_set(&interval, 2, 0);
RUNTIME_CHECK(isc_timer_create(timgr, isc_timertype_once, &expires,
- &interval, t3, timeout, "3", &ti3) ==
+ &interval, t3, timeout, three, &ti3) ==
ISC_R_SUCCESS);
isc_task_detach(&t1);