allow lock passing

This commit is contained in:
rsc 2005-01-07 20:52:07 +00:00
parent 8b549a6214
commit 1aa9c533e0

View file

@ -344,9 +344,10 @@ threadqunlock(QLock *l, ulong pc)
{ {
lock(&l->l); lock(&l->l);
//print("qlock unlock %p @%#x by %p (owner %p)\n", l, pc, (*threadnow)(), l->owner); //print("qlock unlock %p @%#x by %p (owner %p)\n", l, pc, (*threadnow)(), l->owner);
if(l->owner != (*threadnow)()){ if(l->owner == 0){
fprint(2, "%s: qunlock pc=0x%lux owner=%p self=%p oops\n", fprint(2, "%s: qunlock pc=0x%lux owner=%p self=%p oops\n",
argv0, pc, l->owner, (*threadnow)()); argv0, pc, l->owner, (*threadnow)());
abort();
} }
if((l->owner = l->waiting.head) != nil){ if((l->owner = l->waiting.head) != nil){
delthread(&l->waiting, l->owner); delthread(&l->waiting, l->owner);