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