mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
venti: make sure arena checksum jobs cannot be missed
This commit is contained in:
parent
d4bf606d29
commit
01c1b7633c
1 changed files with 8 additions and 5 deletions
|
@ -31,7 +31,9 @@ initarenasum(void)
|
|||
{
|
||||
needzeroscore(); /* OS X */
|
||||
|
||||
qlock(&sumlock);
|
||||
sumwait.l = &sumlock;
|
||||
qunlock(&sumlock);
|
||||
|
||||
if(vtproc(sumproc, nil) < 0){
|
||||
seterr(EOk, "can't start arena checksum slave: %r");
|
||||
|
@ -478,9 +480,6 @@ backsumarena(Arena *arena)
|
|||
{
|
||||
ASum *as;
|
||||
|
||||
if(sumwait.l == nil)
|
||||
return;
|
||||
|
||||
as = MK(ASum);
|
||||
if(as == nil)
|
||||
return;
|
||||
|
@ -492,7 +491,12 @@ backsumarena(Arena *arena)
|
|||
else
|
||||
sumq = as;
|
||||
sumqtail = as;
|
||||
rwakeup(&sumwait);
|
||||
/*
|
||||
* Might get here while initializing arenas,
|
||||
* before initarenasum has been called.
|
||||
*/
|
||||
if(sumwait.l)
|
||||
rwakeup(&sumwait);
|
||||
qunlock(&sumlock);
|
||||
}
|
||||
|
||||
|
@ -513,7 +517,6 @@ sumproc(void *unused)
|
|||
qunlock(&sumlock);
|
||||
arena = as->arena;
|
||||
free(as);
|
||||
|
||||
sumarena(arena);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue