github.com/timandy/routine@v1.1.4-0.20240507073150-e4a3e1fe2ba5/runtime.go (about)

     1  package routine
     2  
     3  import (
     4  	"reflect"
     5  	"unsafe"
     6  
     7  	_ "github.com/timandy/routine/g"
     8  )
     9  
    10  // getgp returns the pointer to the current runtime.g.
    11  //
    12  //go:linkname getgp github.com/timandy/routine/g.getgp
    13  func getgp() unsafe.Pointer
    14  
    15  // getg0 returns the value of runtime.g0.
    16  //
    17  //go:linkname getg0 github.com/timandy/routine/g.getg0
    18  func getg0() interface{}
    19  
    20  // getgt returns the type of runtime.g.
    21  //
    22  //go:linkname getgt github.com/timandy/routine/g.getgt
    23  func getgt() reflect.Type