1
0
Fork 0

Instana tracer implementation

This commit is contained in:
Kevin Crawley 2019-02-18 09:52:04 -06:00 committed by Traefiker Bot
parent c2c6aee18a
commit aef24dd74b
43 changed files with 4502 additions and 2 deletions

25
vendor/github.com/opentracing/basictracer-go/util.go generated vendored Normal file
View file

@ -0,0 +1,25 @@
package basictracer
import (
"math/rand"
"sync"
"time"
)
var (
seededIDGen = rand.New(rand.NewSource(time.Now().UnixNano()))
// The golang rand generators are *not* intrinsically thread-safe.
seededIDLock sync.Mutex
)
func randomID() uint64 {
seededIDLock.Lock()
defer seededIDLock.Unlock()
return uint64(seededIDGen.Int63())
}
func randomID2() (uint64, uint64) {
seededIDLock.Lock()
defer seededIDLock.Unlock()
return uint64(seededIDGen.Int63()), uint64(seededIDGen.Int63())
}