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
|
* palloc
|
||||||
*/
|
*/
|
||||||
mmurelease(up);
|
mmurelease(up);
|
||||||
|
unlock(&palloc);
|
||||||
|
|
||||||
up->qnext = procalloc.free;
|
up->qnext = procalloc.free;
|
||||||
procalloc.free = up;
|
procalloc.free = up;
|
||||||
|
|
||||||
unlock(&palloc);
|
/* proc is free now, make sure unlock() wont touch it */
|
||||||
|
up = procalloc.p = nil;
|
||||||
unlock(&procalloc);
|
unlock(&procalloc);
|
||||||
break;
|
sched();
|
||||||
}
|
}
|
||||||
up->mach = nil;
|
up->mach = nil;
|
||||||
updatecpu(up);
|
updatecpu(up);
|
||||||
|
|
Loading…
Reference in a new issue