Skip to content

Commit

Permalink
runtime: add func TailscaleCurrentP
Browse files Browse the repository at this point in the history
Updates #109

Signed-off-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
bradfitz committed Dec 18, 2024
1 parent e005697 commit 161c3b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/go1.99999.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pkg net, type SockTrace struct, DidWrite func(int) #58
pkg net, type SockTrace struct, WillCloseTCPConn func(syscall.RawConn) #58
pkg net, type SockTrace struct, WillOverwrite func(*SockTrace) #58
pkg net/http, func SetRoundTripEnforcer(func(*Request) error) #55
pkg runtime, func TailscaleCurrentP() int #109
8 changes: 8 additions & 0 deletions src/runtime/tailscale_runtime.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package runtime

// TailscaleCurrentP returns the runtime's currently executing 'p' ID.
//
// See https://github.com/tailscale/go/issues/109.
func TailscaleCurrentP() int {
return int(getg().m.p.ptr().id)
}

0 comments on commit 161c3b7

Please sign in to comment.