/* * Given a pointer to the thread list of a procflow, cycles * through all the threadflows on the list, deleting each one * except the FLOW_MASTER. */ void threadflow_delete_all(threadflow_t **threadlist) { threadflow_t *threadflow = *threadlist; (void) ipc_mutex_lock(&filebench_shm->threadflow_lock); filebench_log(LOG_DEBUG_IMPL, "Deleting all threads"); while (threadflow) { if (threadflow->tf_instance && (threadflow->tf_instance == FLOW_MASTER)) { threadflow = threadflow->tf_next; continue; } (void) threadflow_delete(threadlist, threadflow); threadflow = threadflow->tf_next; } (void) ipc_mutex_unlock(&filebench_shm->threadflow_lock); }
/* * Given a pointer to the thread list of a procflow, cycles * through all the threadflows on the list, deleting each one * except the FLOW_MASTER. */ void threadflow_delete_all(threadflow_t **threadlist, int wait_cnt) { threadflow_t *threadflow = *threadlist; (void) ipc_mutex_lock(&filebench_shm->threadflow_lock); filebench_log(LOG_DEBUG_IMPL, "Deleting all threads"); while (threadflow) { if (threadflow->tf_instance && (threadflow->tf_instance == FLOW_MASTER)) { threadflow = threadflow->tf_next; continue; } (void) threadflow_delete(threadlist, threadflow, wait_cnt); threadflow = threadflow->tf_next; /* grow more impatient */ if (wait_cnt > 0) wait_cnt--; } (void) ipc_mutex_unlock(&filebench_shm->threadflow_lock); }