github.com/egonelbre/exp@v0.0.0-20240430123955-ed1d3aa93911/combiner/spin.go (about)

     1  package combiner
     2  
     3  import "runtime"
     4  
     5  type pad7 [7]uint64
     6  
     7  func spin(v *int) {
     8  	*v++
     9  	if *v >= 128 {
    10  		runtime.Gosched()
    11  	}
    12  }
    13  
    14  const busyspin = 8