allow lock passing
This commit is contained in:
parent
8b549a6214
commit
1aa9c533e0
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue