Multithreaded Programming Guide

thr_pool_destroy()

Cancel all queued jobs and destroy the pool. Worker threads that are actively processing tasks are cancelled.

extern	void	thr_pool_destroy(thr_pool_t *pool);

pool is a thread pool identifier that is returned from thr_pool_create().