-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapi_runtime.go
More file actions
25 lines (20 loc) · 788 Bytes
/
api_runtime.go
File metadata and controls
25 lines (20 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2018 Massimiliano Ghilardi. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !gc,!gccgo
// gls/runtime/id.go is deceivingly simple...
// but requires a lot of trickery to compile and install.
// for gc, prefer assembler implementations id_*.s
// for gccgo, prefer the C implementation wrapped by api_gccgo.go
package gls
import (
"github.com/cosmos72/gls/runtime"
)
// return the current goroutine ID.
//
// note that the returned value is DIFFERENT from most other goroutine libraries:
// this GoID() returns the address, converted to uintptr, of the runtime.g struct.
// NOT the runtime.g.goid field returned by most other libraries.
func GoID() uintptr {
return runtime.GoID()
}