Skip to content

Commit

Permalink
id pool test
Browse files Browse the repository at this point in the history
  • Loading branch information
HyungrakJo committed Aug 12, 2022
1 parent 1ec7a62 commit bfbbeee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 6 additions & 6 deletions gid.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package gls

var (
stackTagPool = &idPool{}
import (
"golang.design/x/lockfree"
)

func initIdPool() {
stackTagPool.Pool.New = func() interface{} {
return stackTagPool.newID()
var (
stackTagPool = &idPool{
queue: lockfree.NewQueue(),
}
}
)

// Will return this goroutine's identifier if set. If you always need a
// goroutine identifier, you should use EnsureGoroutineId which will make one
Expand Down
2 changes: 0 additions & 2 deletions stack_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ func init() {
setEntries(github_com_jtolds_gls_markD, 0xd)
setEntries(github_com_jtolds_gls_markE, 0xe)
setEntries(github_com_jtolds_gls_markF, 0xf)

initIdPool()
}

func addStackTag(tag uint32, context_call func()) {
Expand Down

0 comments on commit bfbbeee

Please sign in to comment.