aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-04 22:22:18 +0000
committerrsc <devnull@localhost>2005-01-04 22:22:18 +0000
commit15cd8255b55fdca71e8054e874ffeb077a59b978 (patch)
tree87212a829644972b9822adce2dcd48b6e2cb6814 /src
parent230ead2fbe90864d309218048d5ad13070d536fa (diff)
downloadplan9port-15cd8255b55fdca71e8054e874ffeb077a59b978.tar.gz
plan9port-15cd8255b55fdca71e8054e874ffeb077a59b978.tar.bz2
plan9port-15cd8255b55fdca71e8054e874ffeb077a59b978.zip
more debugging
Diffstat (limited to 'src')
-rw-r--r--src/libthread/thread.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/libthread/thread.c b/src/libthread/thread.c
index 84e21717..1894259b 100644
--- a/src/libthread/thread.c
+++ b/src/libthread/thread.c
@@ -317,7 +317,8 @@ threadqlock(QLock *l, int block, ulong pc)
_threadswitch();
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();
}
//print("qlock wakeup %p @%#x by %p\n", l, pc, (*threadnow)());
@@ -329,10 +330,9 @@ threadqunlock(QLock *l, ulong pc)
{
lock(&l->l);
//print("qlock unlock %p @%#x by %p (owner %p)\n", l, pc, (*threadnow)(), l->owner);
- if(l->owner == nil){
- fprint(2, "qunlock pc=0x%lux owner=%p self=%p oops\n",
- pc, l->owner, (*threadnow)());
- abort();
+ if(l->owner != (*threadnow)()){
+ fprint(2, "%s: qunlock pc=0x%lux owner=%p self=%p oops\n",
+ argv0, pc, l->owner, (*threadnow)());
}
if((l->owner = l->waiting.head) != nil){
delthread(&l->waiting, l->owner);
@@ -505,8 +505,9 @@ main(int argc, char **argv)
mainstacksize = 65536;
_threadcreate(p, threadmainstart, nil, mainstacksize);
scheduler(p);
- threaddaemonize();
+ _threaddaemonize();
_threadpexit();
+ return 0;
}
/*
@@ -606,3 +607,12 @@ delproc(Proc *p)
_threadprocstail = p->prev;
unlock(&_threadprocslock);
}
+
+/*
+ * notify - for now just use the usual mechanisms
+ */
+void
+threadnotify(int (*f)(void*, char*), int in)
+{
+ atnotify(f, in);
+}