M port/alloc.c => port/alloc.c +0 -1
@@ 64,7 64,6 @@ static void
poolprint(Pool *p, char *fmt, ...)
{
va_list v;
- int n;
Private *pv;
pv = p->private;
M port/segment.c => port/segment.c +6 -0
@@ 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--;