github.com/choleraehyq/piD@v0.0.11/p_m_go1.10.go (about)

     1  // +build gc,go1.10,!go1.13
     2  
     3  package goid
     4  
     5  type mutex struct {
     6  	// Futex-based impl treats it as uint32 key,
     7  	// while sema-based impl as M* waitm.
     8  	// Used to be a union, but unions break precise GC.
     9  	key uintptr
    10  }
    11  
    12  type p struct {
    13  	lock mutex
    14  	id   int32 // Here is pid
    15  }
    16  
    17  type m struct {
    18  	g0      uintptr // goroutine with scheduling stack
    19  	morebuf gobuf   // gobuf arg to morestack
    20  	divmod  uint32  // div/mod denominator for arm - known to liblink
    21  
    22  	// Fields not known to debuggers.
    23  	procid     uint64       // for debuggers, but offset not hard-coded
    24  	gsignal    uintptr      // signal-handling g
    25  	goSigStack gsignalStack // Go-allocated signal handling stack
    26  	sigmask    sigset       // storage for saved signal mask
    27  	tls        [6]uintptr   // thread-local storage (for x86 extern register)
    28  	mstartfn   func()
    29  	curg       uintptr // current running goroutine
    30  	caughtsig  uintptr // goroutine running during fatal signal
    31  	p          *p      // attached p for executing go code (nil if not executing go code)
    32  }