Пример #1
0
void ThreadPool_free(ThreadPool** th_pool_ptr)
{
	ThreadPool_close(*th_pool_ptr);

	Queue_free(&((*th_pool_ptr)->idle_queue));
	Queue_free(&((*th_pool_ptr)->curt_queue));

	pthread_mutex_destroy(&((*th_pool_ptr)->pool_lock));
	pthread_cond_destroy(&((*th_pool_ptr)->pool_cond));
	pthread_mutex_destroy(&((*th_pool_ptr)->stop_lock));
	pthread_cond_destroy(&((*th_pool_ptr)->stop_cond));

	safe_free((void**)th_pool_ptr);

	log_debug(log_cat, "thread pool free success");
}
Пример #2
0
void threadpool_close(ThreadPool *threadpool) {
    ThreadPool_close(threadpool);
    free(threadpool);
}