summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@rei2>2012-02-05 20:52:12 +0100
committercinap_lenrek <cinap_lenrek@rei2>2012-02-05 20:52:12 +0100
commit3599f733ee9828b80a6f470646463793e01838e3 (patch)
treea878608a3bdca6d44fe234cb0efee0f3ef1c6b5f
parent247ceabdb640e8642db6d2d90a2b68ad9112b66f (diff)
more checking for eqlock
-rw-r--r--sys/src/9/port/proc.c9
-rw-r--r--sys/src/9/port/qlock.c7
2 files changed, 14 insertions, 2 deletions
diff --git a/sys/src/9/port/proc.c b/sys/src/9/port/proc.c
index 669c4652f..c101b9988 100644
--- a/sys/src/9/port/proc.c
+++ b/sys/src/9/port/proc.c
@@ -88,6 +88,9 @@ schedinit(void) /* never returns */
mmurelease(up);
unlock(&palloc);
+ up->mach = nil;
+ updatecpu(up);
+
up->qnext = procalloc.free;
procalloc.free = up;
@@ -411,6 +414,11 @@ ready(Proc *p)
Schedq *rq;
void (*pt)(Proc*, int, vlong);
+ if(p->state == Ready){
+ print("double ready %s %lud pc %p\n", p->text, p->pid, getcallerpc(&p));
+ return;
+ }
+
s = splhi();
if(edfready(p)){
splx(s);
@@ -601,6 +609,7 @@ newproc(void)
p->state = Scheding;
p->psstate = "New";
p->mach = 0;
+ p->eql = 0;
p->qnext = 0;
p->nchild = 0;
p->nwait = 0;
diff --git a/sys/src/9/port/qlock.c b/sys/src/9/port/qlock.c
index e15569ff5..445161145 100644
--- a/sys/src/9/port/qlock.c
+++ b/sys/src/9/port/qlock.c
@@ -24,7 +24,8 @@ eqlock(QLock *q)
print("eqlock: %#p: ilockdepth %d\n", getcallerpc(&q), m->ilockdepth);
if(up != nil && up->nlocks.ref)
print("eqlock: %#p: nlocks %lud\n", getcallerpc(&q), up->nlocks.ref);
-
+ if(up != nil && up->eql)
+ print("eqlock: %#p: eql %p\n", getcallerpc(&q), up->eql);
if(q->use.key == 0x55555555)
panic("eqlock: q %#p, key 5*\n", q);
@@ -58,6 +59,7 @@ eqlock(QLock *q)
up->notepending = 0;
error(Eintr);
}
+ up->eql = 0;
}
void
@@ -69,7 +71,8 @@ qlock(QLock *q)
print("qlock: %#p: ilockdepth %d\n", getcallerpc(&q), m->ilockdepth);
if(up != nil && up->nlocks.ref)
print("qlock: %#p: nlocks %lud\n", getcallerpc(&q), up->nlocks.ref);
-
+ if(up != nil && up->eql)
+ print("qlock: %#p: eql %p\n", getcallerpc(&q), up->eql);
if(q->use.key == 0x55555555)
panic("qlock: q %#p, key 5*\n", q);
lock(&q->use);