fix unlock(&procalloc) race on mp systems
This commit is contained in:
parent
158a3cf4dd
commit
e2bbb41a30
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue