diff options
author | Russ Cox <rsc@swtch.com> | 2008-07-03 22:39:59 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-07-03 22:39:59 -0400 |
commit | 01c1b7633c0576ad30880ce8dd96aa20e9bfdbc2 (patch) | |
tree | 2af41e1a3c3d28fc955c83d80ff1e8bacc90cc89 /src/cmd/venti | |
parent | d4bf606d29304006a85a35a8f09d38bf1529d2af (diff) | |
download | plan9port-01c1b7633c0576ad30880ce8dd96aa20e9bfdbc2.tar.gz plan9port-01c1b7633c0576ad30880ce8dd96aa20e9bfdbc2.tar.bz2 plan9port-01c1b7633c0576ad30880ce8dd96aa20e9bfdbc2.zip |
venti: make sure arena checksum jobs cannot be missed
Diffstat (limited to 'src/cmd/venti')
-rw-r--r-- | src/cmd/venti/srv/arena.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/cmd/venti/srv/arena.c b/src/cmd/venti/srv/arena.c index d77e0ccf..08952aa1 100644 --- a/src/cmd/venti/srv/arena.c +++ b/src/cmd/venti/srv/arena.c @@ -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); } } |