bin/varnishd/cache/cache_pool.c
int
Pool_Task_Any(struct pool_task *task, enum task_prio prio)
{
	struct pool *pp;

	Lck_Lock(&pool_mtx);
	pp = VTAILQ_FIRST(&pools);
	if (pp != NULL) {
		VTAILQ_REMOVE(&pools, pp, list);
		VTAILQ_INSERT_TAIL(&pools, pp, list);
	}
	Lck_Unlock(&pool_mtx);
	if (pp == NULL)
		return (-1);
	// NB: When we remove pools, is there a race here ?
	return (Pool_Task(pp, task, prio));
}
/*--------------------------------------------------------------------
 * Facility for scheduling a task on any convenient pool.
 */
Facility for scheduling a task on any convenient pool.
Facility for scheduling a task on any convenient pool .
int
Pool_Task_Any(struct pool_task *task, enum task_prio prio)
{
	struct pool *pp;
	Lck_Lock(&pool_mtx);
	pp = VTAILQ_FIRST(&pools);
	if (pp != NULL) {
		VTAILQ_REMOVE(&pools, pp, list);
		VTAILQ_INSERT_TAIL(&pools, pp, list);
	}
	Lck_Unlock(&pool_mtx);
	if (pp == NULL)
		return (-1);
	return (Pool_Task(pp, task, prio));
}
int Pool_Task_Any ( struct pool_task * task , enum task_prio prio ) { struct pool * pp ; Lck_Lock ( & pool_mtx ) ; pp = VTAILQ_FIRST ( & pools ) ; if ( pp != NULL ) { VTAILQ_REMOVE ( & pools , pp , list ) ; VTAILQ_INSERT_TAIL ( & pools , pp , list ) ; } Lck_Unlock ( & pool_mtx ) ; if ( pp == NULL ) return ( -1 ) ; return ( Pool_Task ( pp , task , prio ) ) ; }
Facility for scheduling a task on any convenient pool.
Facility for scheduling a task on any convenient pool .
// NB: When we remove pools, is there a race here ?