Exemple #1
0
void
runtime·lock(Lock *l)
{
	if(m->locks++ < 0)
		runtime·throw("runtime·lock: lock count");
	futexlock(l);
}
Exemple #2
0
void
lock(Lock *l)
{
	if(m->locks < 0)
		throw("lock count");
	m->locks++;
	futexlock(l);
}
Exemple #3
0
void
runtime·lock(Lock *l)
{
	if(m->locks < 0)
		runtime·throw("lock count");
	m->locks++;
	futexlock(l);
}
Exemple #4
0
void
notesleep(Note *n)
{
	futexlock(&n->lock);
	futexunlock(&n->lock);	// Let other sleepers find out too.
}
Exemple #5
0
void
noteclear(Note *n)
{
	n->lock.key = 0;	// memset(n, 0, sizeof *n)
	futexlock(&n->lock);
}