mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
3353. [bug] Use a single task for task exclusive operations.
[RT #29872]
This commit is contained in:
@@ -42,6 +42,7 @@ isc_log_t *lctx = NULL;
|
||||
isc_taskmgr_t *taskmgr = NULL;
|
||||
isc_timermgr_t *timermgr = NULL;
|
||||
isc_socketmgr_t *socketmgr = NULL;
|
||||
isc_task_t *maintask = NULL;
|
||||
int ncpus;
|
||||
|
||||
static isc_boolean_t hash_active = ISC_FALSE;
|
||||
@@ -63,6 +64,8 @@ static isc_logcategory_t categories[] = {
|
||||
|
||||
static void
|
||||
cleanup_managers() {
|
||||
if (maintask != NULL)
|
||||
isc_task_destroy(&maintask);
|
||||
if (socketmgr != NULL)
|
||||
isc_socketmgr_destroy(&socketmgr);
|
||||
if (taskmgr != NULL)
|
||||
@@ -81,6 +84,9 @@ create_managers() {
|
||||
#endif
|
||||
|
||||
CHECK(isc_taskmgr_create(mctx, ncpus, 0, &taskmgr));
|
||||
CHECK(isc_task_create(taskmgr, 0, &maintask));
|
||||
isc_taskmgr_setexcltask(taskmgr, maintask);
|
||||
|
||||
CHECK(isc_timermgr_create(mctx, &timermgr));
|
||||
CHECK(isc_socketmgr_create(mctx, &socketmgr));
|
||||
return (ISC_R_SUCCESS);
|
||||
@@ -138,6 +144,8 @@ isc_test_begin(FILE *logfile, isc_boolean_t start_managers) {
|
||||
|
||||
void
|
||||
isc_test_end() {
|
||||
if (maintask != NULL)
|
||||
isc_task_detach(&maintask);
|
||||
if (taskmgr != NULL)
|
||||
isc_taskmgr_destroy(&taskmgr);
|
||||
if (lctx != NULL)
|
||||
|
Reference in New Issue
Block a user