// Yield should be called in spinning loops and will assure correct
// spin/wait/schedule behavior according to the set priority.
Yield should be called in spinning loops and will assure correct
spin/wait/schedule behavior according to the set priority.
// Yield should be called in spinning loops and will assure correct // spin / wait / schedule behavior according to the set priority .
func (spin *Spinner) Yield() {
	if spin.count >= 100 {
		spin.count = 0
		if spin.suspendFor == 0 {
			runtime.Gosched()
		} else {
			time.Sleep(spin.suspendFor)
		}
		return 
	}
	spin.count++
}
func ( spin * Spinner ) Yield ( ) { if spin . count >= 100 { spin . count = 0 if spin . suspendFor == 0 { runtime . Gosched ( ) } else { time . Sleep ( spin . suspendFor ) } return } spin . count ++ }
Yield should be called in spinning loops and will assure correct
spin/wait/schedule behavior according to the set priority.
Yield should be called in spinning loops and will assure correct spin / wait / schedule behavior according to the set priority .
// Always call Gosched if suspending is disabled to prevent stuck go // routines with GOMAXPROCS=1 and to be nice to the scheduler // ### return, suspended ###