File tree 1 file changed +8
-5
lines changed 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -2606,9 +2606,10 @@ stop:
2606
2606
// safe-points. We don't need to snapshot the contents because
2607
2607
// everything up to cap(allp) is immutable.
2608
2608
allpSnapshot := allp
2609
- // Also snapshot idlepMask . Value changes are OK, but we can't allow
2609
+ // Also snapshot masks . Value changes are OK, but we can't allow
2610
2610
// len to change out from under us.
2611
2611
idlepMaskSnapshot := idlepMask
2612
+ timerpMaskSnapshot := timerpMask
2612
2613
2613
2614
// return P and block
2614
2615
lock (& sched .lock )
@@ -2670,10 +2671,12 @@ stop:
2670
2671
// transitioning from spinning to non-spinning. Note that we cannot use
2671
2672
// checkTimers here because it calls adjusttimers which may need to allocate
2672
2673
// memory, and that isn't allowed when we don't have an active P.
2673
- for _ , _p_ := range allpSnapshot {
2674
- w := nobarrierWakeTime (_p_ )
2675
- if w != 0 && (pollUntil == 0 || w < pollUntil ) {
2676
- pollUntil = w
2674
+ for id , _p_ := range allpSnapshot {
2675
+ if timerpMaskSnapshot .read (uint32 (id )) {
2676
+ w := nobarrierWakeTime (_p_ )
2677
+ if w != 0 && (pollUntil == 0 || w < pollUntil ) {
2678
+ pollUntil = w
2679
+ }
2677
2680
}
2678
2681
}
2679
2682
if pollUntil != 0 {
You can’t perform that action at this time.
0 commit comments