summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@rei2.9hal>2012-01-22 22:33:15 +0100
committercinap_lenrek <cinap_lenrek@rei2.9hal>2012-01-22 22:33:15 +0100
commite2bbb41a308267c5bcc2c6a8c5224b1638a2904f (patch)
tree86b48232170083d874fa042ccb51ee85177821c0
parent158a3cf4dda6d7d8bb0a8688d58bf267d75041bb (diff)
downloadplan9front-e2bbb41a308267c5bcc2c6a8c5224b1638a2904f.tar.xz
fix unlock(&procalloc) race on mp systems
-rw-r--r--sys/src/9/port/proc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/src/9/port/proc.c b/sys/src/9/port/proc.c
index 118561f3a..669c4652f 100644
--- a/sys/src/9/port/proc.c
+++ b/sys/src/9/port/proc.c
@@ -86,13 +86,15 @@ schedinit(void) /* never returns */
* palloc
*/
mmurelease(up);
+ unlock(&palloc);
up->qnext = procalloc.free;
procalloc.free = up;
- unlock(&palloc);
+ /* proc is free now, make sure unlock() wont touch it */
+ up = procalloc.p = nil;
unlock(&procalloc);
- break;
+ sched();
}
up->mach = nil;
updatecpu(up);