diff options
| author | cinap_lenrek <cinap_lenrek@rei2.9hal> | 2012-01-22 22:33:15 +0100 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@rei2.9hal> | 2012-01-22 22:33:15 +0100 |
| commit | e2bbb41a308267c5bcc2c6a8c5224b1638a2904f (patch) | |
| tree | 86b48232170083d874fa042ccb51ee85177821c0 | |
| parent | 158a3cf4dda6d7d8bb0a8688d58bf267d75041bb (diff) | |
| download | plan9front-e2bbb41a308267c5bcc2c6a8c5224b1638a2904f.tar.xz | |
fix unlock(&procalloc) race on mp systems
| -rw-r--r-- | sys/src/9/port/proc.c | 6 |
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); |
