Skip to content

Commit 3f910f6

Browse files
committed
runtime: add func TailscaleCurrentP
Updates #109 Signed-off-by: Brad Fitzpatrick <[email protected]>
1 parent e005697 commit 3f910f6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

api/go1.99999.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ pkg net, type SockTrace struct, DidWrite func(int) #58
99
pkg net, type SockTrace struct, WillCloseTCPConn func(syscall.RawConn) #58
1010
pkg net, type SockTrace struct, WillOverwrite func(*SockTrace) #58
1111
pkg net/http, func SetRoundTripEnforcer(func(*Request) error) #55
12+
pkg runtime, func TailscaleCurrentP() int #109

src/runtime/tailscale_runtime.go

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package runtime
2+
3+
// TailscaleCurrentP returns the runtime's currently executing 'p' ID.
4+
//
5+
// See https://github.com/tailscale/go/issues/109.
6+
func TailscaleCurrentP() int {
7+
return int(getg().m.p.ptr().id)
8+
}

0 commit comments

Comments
 (0)