// we transition from mark termination to sweep.
sweepWaiters struct {
lock mutex
- head guintptr
+ list gList
}
// cycles is the number of completed GC cycles, where a GC
// Wait until sweep termination, mark, and mark
// termination of cycle N complete.
- gp := getg()
- gp.schedlink = work.sweepWaiters.head
- work.sweepWaiters.head.set(gp)
+ work.sweepWaiters.list.push(getg())
goparkunlock(&work.sweepWaiters.lock, waitReasonWaitForGCCycle, traceEvGoBlock, 1)
}
}
// Bump GC cycle count and wake goroutines waiting on sweep.
lock(&work.sweepWaiters.lock)
memstats.numgc++
- injectglist(work.sweepWaiters.head.ptr())
- work.sweepWaiters.head = 0
+ injectglist(work.sweepWaiters.list.head.ptr())
+ work.sweepWaiters.list = gList{}
unlock(&work.sweepWaiters.lock)
// Finish the current heap profiling cycle and start a new