FreeBSD/cddl/compat/opensolaris/misc/thread_pool.c
/*
 * Called by a worker thread on return from a tpool_dispatch()d job.
 */
Called by a worker thread on return from a tpool_dispatch()d job.
Called by a worker thread on return from a tpool_dispatch () d job .
static void
job_cleanup(void *arg)
{
	tpool_t *tpool = arg;
	pthread_t my_tid = pthread_self();
	tpool_active_t *activep;
	tpool_active_t **activepp;
	pthread_mutex_lock(&tpool->tp_mutex);
	for (activepp = &tpool->tp_active;; activepp = &activep->tpa_next) {
		activep = *activepp;
		if (activep->tpa_tid == my_tid) {
			*activepp = activep->tpa_next;
			break;
		}
	}
	if (tpool->tp_flags & TP_WAIT)
		notify_waiters(tpool);
}
static void job_cleanup ( void * arg ) { tpool_t * tpool = arg ; pthread_t my_tid = pthread_self ( ) ; tpool_active_t * activep ; tpool_active_t * * activepp ; pthread_mutex_lock ( & tpool -> tp_mutex ) ; for ( activepp = & tpool -> tp_active ; ; activepp = & activep -> tpa_next ) { activep = * activepp ; if ( activep -> tpa_tid == my_tid ) { * activepp = activep -> tpa_next ; break ; } } if ( tpool -> tp_flags & TP_WAIT ) notify_waiters ( tpool ) ; }
Called by a worker thread on return from a tpool_dispatch()d job.
Called by a worker thread on return from a tpool_dispatch () d job .
/* CSTYLED */