more debugging
This commit is contained in:
parent
230ead2fbe
commit
15cd8255b5
1 changed files with 16 additions and 6 deletions
|
|
@ -317,7 +317,8 @@ threadqlock(QLock *l, int block, ulong pc)
|
||||||
_threadswitch();
|
_threadswitch();
|
||||||
|
|
||||||
if(l->owner != (*threadnow)()){
|
if(l->owner != (*threadnow)()){
|
||||||
fprint(2, "qlock pc=0x%lux owner=%p self=%p oops\n", pc, l->owner, (*threadnow)());
|
fprint(2, "%s: qlock pc=0x%lux owner=%p self=%p oops\n",
|
||||||
|
argv0, pc, l->owner, (*threadnow)());
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
//print("qlock wakeup %p @%#x by %p\n", l, pc, (*threadnow)());
|
//print("qlock wakeup %p @%#x by %p\n", l, pc, (*threadnow)());
|
||||||
|
|
@ -329,10 +330,9 @@ 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 == nil){
|
if(l->owner != (*threadnow)()){
|
||||||
fprint(2, "qunlock pc=0x%lux owner=%p self=%p oops\n",
|
fprint(2, "%s: qunlock pc=0x%lux owner=%p self=%p oops\n",
|
||||||
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);
|
||||||
|
|
@ -505,8 +505,9 @@ main(int argc, char **argv)
|
||||||
mainstacksize = 65536;
|
mainstacksize = 65536;
|
||||||
_threadcreate(p, threadmainstart, nil, mainstacksize);
|
_threadcreate(p, threadmainstart, nil, mainstacksize);
|
||||||
scheduler(p);
|
scheduler(p);
|
||||||
threaddaemonize();
|
_threaddaemonize();
|
||||||
_threadpexit();
|
_threadpexit();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -606,3 +607,12 @@ delproc(Proc *p)
|
||||||
_threadprocstail = p->prev;
|
_threadprocstail = p->prev;
|
||||||
unlock(&_threadprocslock);
|
unlock(&_threadprocslock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* notify - for now just use the usual mechanisms
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
threadnotify(int (*f)(void*, char*), int in)
|
||||||
|
{
|
||||||
|
atnotify(f, in);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue