mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-14 22:49:59 -04:00
return the number of items purged
This commit is contained in:
parent
f02c1d9431
commit
1edb223dd3
2 changed files with 7 additions and 2 deletions
|
|
@ -77,7 +77,7 @@ void isc_task_attach(isc_task_t,
|
|||
void isc_task_detach(isc_task_t *);
|
||||
void isc_task_send(isc_task_t,
|
||||
isc_event_t *);
|
||||
void isc_task_purge(isc_task_t, void *,
|
||||
unsigned int isc_task_purge(isc_task_t, void *,
|
||||
isc_eventtype_t);
|
||||
void isc_task_shutdown(isc_task_t);
|
||||
void isc_task_destroy(isc_task_t *);
|
||||
|
|
|
|||
|
|
@ -341,10 +341,11 @@ isc_task_send(isc_task_t task, isc_event_t *eventp) {
|
|||
XTRACE("sent");
|
||||
}
|
||||
|
||||
void
|
||||
unsigned int
|
||||
isc_task_purge(isc_task_t task, void *sender, isc_eventtype_t type) {
|
||||
isc_event_t event, next_event;
|
||||
isc_eventlist_t purgeable;
|
||||
unsigned int purge_count;
|
||||
|
||||
REQUIRE(VALID_TASK(task));
|
||||
REQUIRE(type >= 0);
|
||||
|
|
@ -356,6 +357,7 @@ isc_task_purge(isc_task_t task, void *sender, isc_eventtype_t type) {
|
|||
*/
|
||||
|
||||
INIT_LIST(purgeable);
|
||||
purge_count = 0;
|
||||
|
||||
LOCK(&task->lock);
|
||||
for (event = HEAD(task->events);
|
||||
|
|
@ -375,7 +377,10 @@ isc_task_purge(isc_task_t task, void *sender, isc_eventtype_t type) {
|
|||
event = next_event) {
|
||||
next_event = NEXT(event, link);
|
||||
isc_event_free(&event);
|
||||
purge_count++;
|
||||
}
|
||||
|
||||
return (purge_count);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in a new issue