Remove dead code

Delete unused functions.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10470
This commit is contained in:
Arvind Sankar
2020-06-15 14:26:43 -04:00
committed by Brian Behlendorf
parent 65c7cc49bf
commit c3fe42aabd
16 changed files with 2 additions and 263 deletions
-53
View File
@@ -597,56 +597,3 @@ tpool_member(tpool_t *tpool)
pthread_mutex_unlock(&tpool->tp_mutex);
return (0);
}
void
postfork1_child_tpool(void)
{
pthread_t my_tid = pthread_self();
tpool_t *tpool;
tpool_job_t *job;
/*
* All of the thread pool workers are gone, except possibly
* for the current thread, if it is a thread pool worker thread.
* Retain the thread pools, but make them all empty. Whatever
* jobs were queued or running belong to the parent process.
*/
top:
if ((tpool = thread_pools) == NULL)
return;
do {
tpool_active_t *activep;
(void) pthread_mutex_init(&tpool->tp_mutex, NULL);
(void) pthread_cond_init(&tpool->tp_busycv, NULL);
(void) pthread_cond_init(&tpool->tp_workcv, NULL);
(void) pthread_cond_init(&tpool->tp_waitcv, NULL);
for (job = tpool->tp_head; job; job = tpool->tp_head) {
tpool->tp_head = job->tpj_next;
free(job);
}
tpool->tp_tail = NULL;
tpool->tp_njobs = 0;
for (activep = tpool->tp_active; activep;
activep = activep->tpa_next) {
if (activep->tpa_tid == my_tid) {
activep->tpa_next = NULL;
break;
}
}
tpool->tp_idle = 0;
tpool->tp_current = 0;
if ((tpool->tp_active = activep) != NULL)
tpool->tp_current = 1;
tpool->tp_flags &= ~TP_WAIT;
if (tpool->tp_flags & (TP_DESTROY | TP_ABANDON)) {
tpool->tp_flags &= ~TP_DESTROY;
tpool->tp_flags |= TP_ABANDON;
if (tpool->tp_current == 0) {
delete_pool(tpool);
goto top; /* start over */
}
}
} while ((tpool = tpool->tp_forw) != thread_pools);
}