task.h 14.8 KB
Newer Older
Bob Halley's avatar
Bob Halley committed
1
/*
Automatic Updater's avatar
Automatic Updater committed
2
 * Copyright (C) 2004-2007, 2009  Internet Systems Consortium, Inc. ("ISC")
Mark Andrews's avatar
Mark Andrews committed
3
 * Copyright (C) 1998-2001, 2003  Internet Software Consortium.
4
 *
Automatic Updater's avatar
Automatic Updater committed
5
 * Permission to use, copy, modify, and/or distribute this software for any
Bob Halley's avatar
Bob Halley committed
6 7
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
8
 *
Mark Andrews's avatar
Mark Andrews committed
9 10 11 12 13 14 15
 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
Bob Halley's avatar
Bob Halley committed
16
 */
Bob Halley's avatar
update  
Bob Halley committed
17

Automatic Updater's avatar
Automatic Updater committed
18
/* $Id: task.h,v 1.63 2009/01/18 23:48:14 tbox Exp $ */
David Lawrence's avatar
David Lawrence committed
19

Bob Halley's avatar
Bob Halley committed
20 21
#ifndef ISC_TASK_H
#define ISC_TASK_H 1
Bob Halley's avatar
update  
Bob Halley committed
22

Bob Halley's avatar
Bob Halley committed
23 24 25 26
/*****
 ***** Module Info
 *****/

27
/*! \file isc/task.h
28
 * \brief The task system provides a lightweight execution context, which is
Automatic Updater's avatar
Automatic Updater committed
29
 * basically an event queue.
30 31

 * When a task's event queue is non-empty, the
32 33 34
 * task is runnable.  A small work crew of threads, typically one per CPU,
 * execute runnable tasks by dispatching the events on the tasks' event
 * queues.  Context switching between tasks is fast.
Bob Halley's avatar
Bob Halley committed
35
 *
36
 * \li MP:
Bob Halley's avatar
Bob Halley committed
37 38 39 40 41
 *	The module ensures appropriate synchronization of data structures it
 *	creates and manipulates.
 *	The caller must ensure that isc_taskmgr_destroy() is called only
 *	once for a given manager.
 *
42
 * \li Reliability:
Bob Halley's avatar
Bob Halley committed
43 44
 *	No anticipated impact.
 *
45 46
 * \li Resources:
 *	TBS
Bob Halley's avatar
Bob Halley committed
47
 *
48
 * \li Security:
Bob Halley's avatar
Bob Halley committed
49 50
 *	No anticipated impact.
 *
51
 * \li Standards:
Bob Halley's avatar
Bob Halley committed
52
 *	None.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
 *
 * \section purge Purging and Unsending
 *
 * Events which have been queued for a task but not delivered may be removed
 * from the task's event queue by purging or unsending.
 *
 * With both types, the caller specifies a matching pattern that selects
 * events based upon their sender, type, and tag.
 *
 * Purging calls isc_event_free() on the matching events.
 *
 * Unsending returns a list of events that matched the pattern.
 * The caller is then responsible for them.
 *
 * Consumers of events should purge, not unsend.
 *
 * Producers of events often want to remove events when the caller indicates
Francis Dupont's avatar
Francis Dupont committed
70
 * it is no longer interested in the object, e.g. by canceling a timer.
71 72 73 74 75
 * Sometimes this can be done by purging, but for some event types, the
 * calls to isc_event_free() cause deadlock because the event free routine
 * wants to acquire a lock the caller is already holding.  Unsending instead
 * of purging solves this problem.  As a general rule, producers should only
 * unsend events which they have sent.
Bob Halley's avatar
Bob Halley committed
76 77 78 79 80 81 82
 */


/***
 *** Imports.
 ***/

83
#include <isc/eventclass.h>
Bob Halley's avatar
Bob Halley committed
84
#include <isc/lang.h>
85
#include <isc/stdtime.h>
86
#include <isc/types.h>
87
#include <isc/xml.h>
Bob Halley's avatar
update  
Bob Halley committed
88

89 90 91
#define ISC_TASKEVENT_FIRSTEVENT	(ISC_EVENTCLASS_TASK + 0)
#define ISC_TASKEVENT_SHUTDOWN		(ISC_EVENTCLASS_TASK + 1)
#define ISC_TASKEVENT_LASTEVENT		(ISC_EVENTCLASS_TASK + 65535)
Bob Halley's avatar
update  
Bob Halley committed
92

Bob Halley's avatar
Bob Halley committed
93 94 95
/*****
 ***** Tasks.
 *****/
Bob Halley's avatar
update  
Bob Halley committed
96

97 98
ISC_LANG_BEGINDECLS

99
isc_result_t
100 101
isc_task_create(isc_taskmgr_t *manager, unsigned int quantum,
		isc_task_t **taskp);
102
/*%<
103
 * Create a task.
104 105 106
 *
 * Notes:
 *
107
 *\li	If 'quantum' is non-zero, then only that many events can be dispatched
108 109 110 111
 *	before the task must yield to other tasks waiting to execute.  If
 *	quantum is zero, then the default quantum of the task manager will
 *	be used.
 *
112
 *\li	The 'quantum' option may be removed from isc_task_create() in the
113 114 115 116 117
 *	future.  If this happens, isc_task_getquantum() and
 *	isc_task_setquantum() will be provided.
 *
 * Requires:
 *
118
 *\li	'manager' is a valid task manager.
119
 *
120
 *\li	taskp != NULL && *taskp == NULL
121 122 123
 *
 * Ensures:
 *
124
 *\li	On success, '*taskp' is bound to the new task.
125 126 127
 *
 * Returns:
 *
128 129 130 131
 *\li   #ISC_R_SUCCESS
 *\li	#ISC_R_NOMEMORY
 *\li	#ISC_R_UNEXPECTED
 *\li	#ISC_R_SHUTTINGDOWN
132 133 134 135
 */

void
isc_task_attach(isc_task_t *source, isc_task_t **targetp);
136
/*%<
137 138 139 140
 * Attach *targetp to source.
 *
 * Requires:
 *
141
 *\li	'source' is a valid task.
142
 *
143
 *\li	'targetp' points to a NULL isc_task_t *.
144 145 146
 *
 * Ensures:
 *
147
 *\li	*targetp is attached to source.
148 149 150 151
 */

void
isc_task_detach(isc_task_t **taskp);
152
/*%<
153 154 155 156
 * Detach *taskp from its task.
 *
 * Requires:
 *
157
 *\li	'*taskp' is a valid task.
158 159 160
 *
 * Ensures:
 *
161
 *\li	*taskp is NULL.
162
 *
163
 *\li	If '*taskp' is the last reference to the task, the task is idle (has
Bob Halley's avatar
Bob Halley committed
164 165 166
 *	an empty event queue), and has not been shutdown, the task will be
 *	shutdown.
 *
167
 *\li	If '*taskp' is the last reference to the task and
168
 *	the task has been shutdown,
169
 *		all resources used by the task will be freed.
170 171
 */

Bob Halley's avatar
Bob Halley committed
172
void
173
isc_task_send(isc_task_t *task, isc_event_t **eventp);
174
/*%<
175 176 177 178
 * Send '*event' to 'task'.
 *
 * Requires:
 *
179 180
 *\li	'task' is a valid task.
 *\li	eventp != NULL && *eventp != NULL.
181
 *
182
 * Ensures:
183
 *
184
 *\li	*eventp == NULL.
185 186
 */

Bob Halley's avatar
Bob Halley committed
187
void
Bob Halley's avatar
Bob Halley committed
188
isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp);
189
/*%<
Bob Halley's avatar
Bob Halley committed
190 191 192 193 194
 * Send '*event' to '*taskp' and then detach '*taskp' from its
 * task.
 *
 * Requires:
 *
195 196
 *\li	'*taskp' is a valid task.
 *\li	eventp != NULL && *eventp != NULL.
Bob Halley's avatar
Bob Halley committed
197
 *
198
 * Ensures:
Bob Halley's avatar
Bob Halley committed
199
 *
200
 *\li	*eventp == NULL.
Bob Halley's avatar
Bob Halley committed
201
 *
202
 *\li	*taskp == NULL.
Bob Halley's avatar
Bob Halley committed
203
 *
204
 *\li	If '*taskp' is the last reference to the task, the task is
Bob Halley's avatar
Bob Halley committed
205 206
 *	idle (has an empty event queue), and has not been shutdown,
 *	the task will be shutdown.
Bob Halley's avatar
Bob Halley committed
207
 *
208
 *\li	If '*taskp' is the last reference to the task and
Bob Halley's avatar
Bob Halley committed
209
 *	the task has been shutdown,
210
 *		all resources used by the task will be freed.
Bob Halley's avatar
Bob Halley committed
211 212 213
 */


214 215
unsigned int
isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first,
Bob Halley's avatar
Bob Halley committed
216
		    isc_eventtype_t last, void *tag);
217
/*%<
218 219 220 221
 * Purge events from a task's event queue.
 *
 * Requires:
 *
222
 *\li	'task' is a valid task.
223
 *
224
 *\li	last >= first
225
 *
Bob Halley's avatar
Bob Halley committed
226 227
 * Ensures:
 *
228
 *\li	Events in the event queue of 'task' whose sender is 'sender', whose
Bob Halley's avatar
Bob Halley committed
229 230
 *	type is >= first and <= last, and whose tag is 'tag' will be purged,
 *	unless they are marked as unpurgable.
231
 *
232
 *\li	A sender of NULL will match any sender.  A NULL tag matches any
Bob Halley's avatar
Bob Halley committed
233
 *	tag.
Bob Halley's avatar
Bob Halley committed
234
 *
235 236
 * Returns:
 *
237
 *\li	The number of events purged.
238 239 240
 */

unsigned int
Bob Halley's avatar
Bob Halley committed
241
isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type,
Bob Halley's avatar
Bob Halley committed
242
	       void *tag);
243
/*%<
244 245 246 247
 * Purge events from a task's event queue.
 *
 * Notes:
 *
248
 *\li	This function is equivalent to
249
 *
250
 *\code
Bob Halley's avatar
Bob Halley committed
251
 *		isc_task_purgerange(task, sender, type, type, tag);
252
 *\endcode
253 254 255
 *
 * Requires:
 *
256
 *\li	'task' is a valid task.
257
 *
Bob Halley's avatar
Bob Halley committed
258 259
 * Ensures:
 *
260
 *\li	Events in the event queue of 'task' whose sender is 'sender', whose
Bob Halley's avatar
Bob Halley committed
261 262 263
 *	type is 'type', and whose tag is 'tag' will be purged, unless they
 *	are marked as unpurgable.
 *
264
 *\li	A sender of NULL will match any sender.  A NULL tag matches any
Bob Halley's avatar
Bob Halley committed
265
 *	tag.
Bob Halley's avatar
Bob Halley committed
266
 *
267 268
 * Returns:
 *
269
 *\li	The number of events purged.
270 271
 */

Bob Halley's avatar
Bob Halley committed
272 273
isc_boolean_t
isc_task_purgeevent(isc_task_t *task, isc_event_t *event);
274
/*%<
Bob Halley's avatar
Bob Halley committed
275 276
 * Purge 'event' from a task's event queue.
 *
Bob Halley's avatar
Bob Halley committed
277 278
 * XXXRTH:  WARNING:  This method may be removed before beta.
 *
Bob Halley's avatar
Bob Halley committed
279 280
 * Notes:
 *
281
 *\li	If 'event' is on the task's event queue, it will be purged,
Bob Halley's avatar
Bob Halley committed
282 283 284 285 286
 * 	unless it is marked as unpurgeable.  'event' does not have to be
 *	on the task's event queue; in fact, it can even be an invalid
 *	pointer.  Purging only occurs if the event is actually on the task's
 *	event queue.
 *
287
 * \li	Purging never changes the state of the task.
Bob Halley's avatar
Bob Halley committed
288 289 290
 *
 * Requires:
 *
291
 *\li	'task' is a valid task.
Bob Halley's avatar
Bob Halley committed
292 293 294
 *
 * Ensures:
 *
295
 *\li	'event' is not in the event queue for 'task'.
Bob Halley's avatar
Bob Halley committed
296 297 298
 *
 * Returns:
 *
299 300
 *\li	#ISC_TRUE			The event was purged.
 *\li	#ISC_FALSE			The event was not in the event queue,
Bob Halley's avatar
Bob Halley committed
301 302
 *					or was marked unpurgeable.
 */
303

Bob Halley's avatar
Bob Halley committed
304 305 306
unsigned int
isc_task_unsendrange(isc_task_t *task, void *sender, isc_eventtype_t first,
		     isc_eventtype_t last, void *tag, isc_eventlist_t *events);
307
/*%<
Bob Halley's avatar
Bob Halley committed
308 309 310 311
 * Remove events from a task's event queue.
 *
 * Requires:
 *
312
 *\li	'task' is a valid task.
Bob Halley's avatar
Bob Halley committed
313
 *
314
 *\li	last >= first.
Bob Halley's avatar
Bob Halley committed
315
 *
316
 *\li	*events is a valid list.
Bob Halley's avatar
Bob Halley committed
317 318 319
 *
 * Ensures:
 *
320
 *\li	Events in the event queue of 'task' whose sender is 'sender', whose
Bob Halley's avatar
Bob Halley committed
321 322
 *	type is >= first and <= last, and whose tag is 'tag' will be dequeued
 *	and appended to *events.
323
 *
324
 *\li	A sender of NULL will match any sender.  A NULL tag matches any
Bob Halley's avatar
Bob Halley committed
325 326 327 328
 *	tag.
 *
 * Returns:
 *
329
 *\li	The number of events unsent.
Bob Halley's avatar
Bob Halley committed
330 331 332 333 334
 */

unsigned int
isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type,
		void *tag, isc_eventlist_t *events);
335
/*%<
Bob Halley's avatar
Bob Halley committed
336 337 338 339
 * Remove events from a task's event queue.
 *
 * Notes:
 *
340
 *\li	This function is equivalent to
Bob Halley's avatar
Bob Halley committed
341
 *
342
 *\code
Bob Halley's avatar
Bob Halley committed
343
 *		isc_task_unsendrange(task, sender, type, type, tag, events);
344
 *\endcode
Bob Halley's avatar
Bob Halley committed
345 346 347
 *
 * Requires:
 *
348
 *\li	'task' is a valid task.
Bob Halley's avatar
Bob Halley committed
349
 *
350
 *\li	*events is a valid list.
Bob Halley's avatar
Bob Halley committed
351 352 353
 *
 * Ensures:
 *
354
 *\li	Events in the event queue of 'task' whose sender is 'sender', whose
Bob Halley's avatar
Bob Halley committed
355 356 357 358 359
 *	type is 'type', and whose tag is 'tag' will be dequeued and appended
 *	to *events.
 *
 * Returns:
 *
360
 *\li	The number of events unsent.
Bob Halley's avatar
Bob Halley committed
361 362
 */

363
isc_result_t
David Lawrence's avatar
David Lawrence committed
364 365
isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action,
		    const void *arg);
366
/*%<
367 368 369 370 371
 * Send a shutdown event with action 'action' and argument 'arg' when
 * 'task' is shutdown.
 *
 * Notes:
 *
372
 *\li	Shutdown events are posted in LIFO order.
373 374 375
 *
 * Requires:
 *
376
 *\li	'task' is a valid task.
377
 *
378
 *\li	'action' is a valid task action.
379 380 381
 *
 * Ensures:
 *
382
 *\li	When the task is shutdown, shutdown events requested with
383 384
 *	isc_task_onshutdown() will be appended to the task's event queue.
 *
David Lawrence's avatar
David Lawrence committed
385

386 387
 * Returns:
 *
388 389 390
 *\li	#ISC_R_SUCCESS
 *\li	#ISC_R_NOMEMORY
 *\li	#ISC_R_TASKSHUTTINGDOWN			Task is shutting down.
391 392 393 394
 */

void
isc_task_shutdown(isc_task_t *task);
395
/*%<
396 397 398 399
 * Shutdown 'task'.
 *
 * Notes:
 *
400
 *\li	Shutting down a task causes any shutdown events requested with
401 402
 *	isc_task_onshutdown() to be posted (in LIFO order).  The task
 *	moves into a "shutting down" mode which prevents further calls
Bob Halley's avatar
Bob Halley committed
403
 *	to isc_task_onshutdown().
404
 *
405
 *\li	Trying to shutdown a task that has already been shutdown has no
406 407 408 409
 *	effect.
 *
 * Requires:
 *
410
 *\li	'task' is a valid task.
411 412 413
 *
 * Ensures:
 *
414
 *\li	Any shutdown events requested with isc_task_onshutdown() have been
415 416 417 418 419
 *	posted (in LIFO order).
 */

void
isc_task_destroy(isc_task_t **taskp);
420
/*%<
421 422 423 424
 * Destroy '*taskp'.
 *
 * Notes:
 *
425
 *\li	This call is equivalent to:
426
 *
427
 *\code
Andreas Gustafsson's avatar
typo  
Andreas Gustafsson committed
428
 *		isc_task_shutdown(*taskp);
429
 *		isc_task_detach(taskp);
430
 *\endcode
431 432 433 434 435 436 437
 *
 * Requires:
 *
 *	'*taskp' is a valid task.
 *
 * Ensures:
 *
438
 *\li	Any shutdown events requested with isc_task_onshutdown() have been
439 440
 *	posted (in LIFO order).
 *
441
 *\li	*taskp == NULL
442
 *
443 444
 *\li	If '*taskp' is the last reference to the task,
 *		all resources used by the task will be freed.
445
 */
Bob Halley's avatar
update  
Bob Halley committed
446

447
void
David Lawrence's avatar
David Lawrence committed
448
isc_task_setname(isc_task_t *task, const char *name, void *tag);
449
/*%<
450 451 452 453
 * Name 'task'.
 *
 * Notes:
 *
454
 *\li	Only the first 15 characters of 'name' will be copied.
455
 *
456
 *\li	Naming a task is currently only useful for debugging purposes.
457 458 459
 *
 * Requires:
 *
460
 *\li	'task' is a valid task.
461
 */
Bob Halley's avatar
update  
Bob Halley committed
462

463 464
const char *
isc_task_getname(isc_task_t *task);
465
/*%<
466 467 468
 * Get the name of 'task', as previously set using isc_task_setname().
 *
 * Notes:
469
 *\li	This function is for debugging purposes only.
470 471
 *
 * Requires:
472
 *\li	'task' is a valid task.
473 474
 *
 * Returns:
475
 *\li	A non-NULL pointer to a null-terminated string.
476 477 478 479 480 481 482
 * 	If the task has not been named, the string is
 * 	empty.
 *
 */

void *
isc_task_gettag(isc_task_t *task);
483
/*%<
484 485 486
 * Get the tag value for  'task', as previously set using isc_task_settag().
 *
 * Notes:
487
 *\li	This function is for debugging purposes only.
488 489
 *
 * Requires:
490
 *\li	'task' is a valid task.
491 492
 */

493 494
isc_result_t
isc_task_beginexclusive(isc_task_t *task);
495
/*%<
496 497 498 499 500
 * Request exclusive access for 'task', which must be the calling
 * task.  Waits for any other concurrently executing tasks to finish their
 * current event, and prevents any new events from executing in any of the
 * tasks sharing a task manager with 'task'.
 *
Automatic Updater's avatar
Automatic Updater committed
501
 * The exclusive access must be relinquished by calling
502 503 504
 * isc_task_endexclusive() before returning from the current event handler.
 *
 * Requires:
505
 *\li	'task' is the calling task.
506 507
 *
 * Returns:
508 509
 *\li	#ISC_R_SUCCESS		The current task now has exclusive access.
 *\li	#ISC_R_LOCKBUSY		Another task has already requested exclusive
510 511 512 513 514
 *				access.
 */

void
isc_task_endexclusive(isc_task_t *task);
515
/*%<
Automatic Updater's avatar
Automatic Updater committed
516
 * Relinquish the exclusive access obtained by isc_task_beginexclusive(),
517 518 519
 * allowing other tasks to execute.
 *
 * Requires:
520
 *\li	'task' is the calling task, and has obtained
521 522 523
 *		exclusive access by calling isc_task_spl().
 */

524 525
void
isc_task_getcurrenttime(isc_task_t *task, isc_stdtime_t *t);
526
/*%<
527 528 529 530
 * Provide the most recent timestamp on the task.  The timestamp is considered
 * as the "current time" in the second-order granularity.
 *
 * Requires:
531 532
 *\li	'task' is a valid task.
 *\li	't' is a valid non NULL pointer.
533 534
 *
 * Ensures:
535
 *\li	'*t' has the "current time".
536
 */
537

Bob Halley's avatar
Bob Halley committed
538 539 540 541 542 543 544
/*****
 ***** Task Manager.
 *****/

isc_result_t
isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers,
		   unsigned int default_quantum, isc_taskmgr_t **managerp);
545
/*%<
Bob Halley's avatar
Bob Halley committed
546 547 548 549
 * Create a new task manager.
 *
 * Notes:
 *
550
 *\li	'workers' in the number of worker threads to create.  In general,
Bob Halley's avatar
Bob Halley committed
551 552 553 554 555
 *	the value should be close to the number of processors in the system.
 *	The 'workers' value is advisory only.  An attempt will be made to
 *	create 'workers' threads, but if at least one thread creation
 *	succeeds, isc_taskmgr_create() may return ISC_R_SUCCESS.
 *
556
 *\li	If 'default_quantum' is non-zero, then it will be used as the default
557 558 559
 *	quantum value when tasks are created.  If zero, then an implementation
 *	defined default quantum will be used.
 *
Bob Halley's avatar
Bob Halley committed
560 561
 * Requires:
 *
562
 *\li      'mctx' is a valid memory context.
Bob Halley's avatar
Bob Halley committed
563
 *
564
 *\li	workers > 0
Bob Halley's avatar
Bob Halley committed
565
 *
566
 *\li	managerp != NULL && *managerp == NULL
Bob Halley's avatar
Bob Halley committed
567 568 569
 *
 * Ensures:
 *
570
 *\li	On success, '*managerp' will be attached to the newly created task
Bob Halley's avatar
Bob Halley committed
571 572 573 574
 *	manager.
 *
 * Returns:
 *
575 576 577 578
 *\li	#ISC_R_SUCCESS
 *\li	#ISC_R_NOMEMORY
 *\li	#ISC_R_NOTHREADS			No threads could be created.
 *\li	#ISC_R_UNEXPECTED		An unexpected error occurred.
Bob Halley's avatar
Bob Halley committed
579 580
 */

581 582
void
isc_taskmgr_destroy(isc_taskmgr_t **managerp);
583
/*%<
584 585 586 587
 * Destroy '*managerp'.
 *
 * Notes:
 *
588
 *\li	Calling isc_taskmgr_destroy() will shutdown all tasks managed by
589 590 591
 *	*managerp that haven't already been shutdown.  The call will block
 *	until all tasks have entered the done state.
 *
592
 *\li	isc_taskmgr_destroy() must not be called by a task event action,
593 594 595
 *	because it would block forever waiting for the event action to
 *	complete.  An event action that wants to cause task manager shutdown
 *	should request some non-event action thread of execution to do the
Francis Dupont's avatar
Francis Dupont committed
596
 *	shutdown, e.g. by signaling a condition variable or using
597 598
 *	isc_app_shutdown().
 *
599
 *\li	Task manager references are not reference counted, so the caller
600 601 602 603 604
 *	must ensure that no attempt will be made to use the manager after
 *	isc_taskmgr_destroy() returns.
 *
 * Requires:
 *
605
 *\li	'*managerp' is a valid task manager.
606
 *
607
 *\li	isc_taskmgr_destroy() has not be called previously on '*managerp'.
608 609 610
 *
 * Ensures:
 *
611
 *\li	All resources used by the task manager, and any tasks it managed,
612 613
 *	have been freed.
 */
Bob Halley's avatar
update  
Bob Halley committed
614

615 616 617 618 619 620 621
#ifdef HAVE_LIBXML2

void
isc_taskmgr_renderxml(isc_taskmgr_t *mgr, xmlTextWriterPtr writer);

#endif

Bob Halley's avatar
Bob Halley committed
622 623
ISC_LANG_ENDDECLS

Bob Halley's avatar
Bob Halley committed
624
#endif /* ISC_TASK_H */