From cced767ad643931a29220b98a76282f4e253950d Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 29 Feb 2000 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2000-02-29 --- port/alloc.c | 1 - port/segment.c | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/port/alloc.c b/port/alloc.c index c2dede5456964cd8c03a8b4649754ff26011a334..fd35e828895e19e79a1c95755f428e05ca390176 100644 --- a/port/alloc.c +++ b/port/alloc.c @@ -64,7 +64,6 @@ static void poolprint(Pool *p, char *fmt, ...) { va_list v; - int n; Private *pv; pv = p->private; diff --git a/port/segment.c b/port/segment.c index 74fc66c4fe2b53e5695ceb89f9121a739d030517..23e0d25d888646a2e718f2ada7f17b284ec5a230 100644 --- a/port/segment.c +++ b/port/segment.c @@ -364,6 +364,12 @@ imagechanreclaim(void) if(!canqlock(&imagealloc.fcreclaim)) return; + /* + * We don't have to recheck that nfreechan > 0 after we + * acquire the lock, because we're the only ones who decrement + * it (the other lock contender increments it), and there's only + * one of us thanks to the qlock above. + */ while(imagealloc.nfreechan > 0){ lock(&imagealloc); imagealloc.nfreechan--;