Avoids spurious wakeups during other sleeping by that goroutine.
Fixes #711.
R=r
CC=golang-dev
https://golang.org/cl/902041
static G *fing;
static Finalizer *finq;
+static int32 fingwait;
+
static void sweepblock(byte*, int64, uint32*, int32);
static void runfinq(void);
// kick off or wake up goroutine to run queued finalizers
if(fing == nil)
fing = newproc1((byte*)runfinq, nil, 0, 0);
- else if(fing->status == Gwaiting)
+ else if(fingwait) {
ready(fing);
+ fingwait = 0;
+ }
}
m->locks--;
f = finq;
finq = nil;
if(f == nil) {
+ fingwait = 1;
g->status = Gwaiting;
gosched();
continue;