void
VBP_Init(void)
{
	pthread_t thr;

	Lck_New(&vbp_mtx, lck_backend);
	vbp_heap = binheap_new(NULL, vbp_cmp, vbp_update);
	AN(vbp_heap);
	AZ(pthread_cond_init(&vbp_cond, NULL));
	WRK_BgThread(&thr, "backend-poller", vbp_thread, NULL);
}
Example #2
0
void
EXP_Init(void)
{
	struct exp_priv *ep;
	pthread_t pt;

	ALLOC_OBJ(ep, EXP_PRIV_MAGIC);
	AN(ep);

	Lck_New(&ep->mtx, lck_exp);
	AZ(pthread_cond_init(&ep->condvar, NULL));
	VSTAILQ_INIT(&ep->inbox);
	exphdl = ep;
	WRK_BgThread(&pt, "cache-exp", exp_thread, ep);
}
static void
server_start(struct vmod_fsdirector_file_system *fs)
{
	struct vdi_simple *vs;
	const struct vrt_backend *be;

	vs = fs->vs;
	be = vs->vrt;

	AN(VSS_resolve(be->ipv4_addr, be->port, &fs->vss_addr));
	fs->sock = VSS_listen(fs->vss_addr[0], be->max_connections);
	assert(fs->sock >= 0);

	WRK_BgThread(&fs->tp, fs->thread_name, server_bgthread, fs);
}