File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,24 @@ type IDGenerator struct {
2525
2626var _ sdktrace.IDGenerator = & IDGenerator {}
2727
28+ // Lock is used to lock the IDGenerator for concurrent use.
29+ // Deprecated: mutex is internal and shall not be used.
30+ func (gen * IDGenerator ) Lock () {
31+ gen .mu .Lock ()
32+ }
33+
34+ // TryLock attempts to lock the IDGenerator for concurrent use.
35+ // Deprecated: mutex is internal and shall not be used.
36+ func (gen * IDGenerator ) TryLock () bool {
37+ return gen .mu .TryLock ()
38+ }
39+
40+ // Unlock is used to unlock the IDGenerator for concurrent use.
41+ // Deprecated: mutex is internal and shall not be used.
42+ func (gen * IDGenerator ) Unlock () {
43+ gen .mu .Unlock ()
44+ }
45+
2846// NewSpanID returns a non-zero span ID from a randomly-chosen sequence.
2947func (gen * IDGenerator ) NewSpanID (context.Context , trace.TraceID ) trace.SpanID {
3048 gen .mu .Lock ()
Original file line number Diff line number Diff line change @@ -95,6 +95,24 @@ func New(
9595 return sampler
9696}
9797
98+ // Lock is used to lock the Sampler for concurrent use.
99+ // Deprecated: mutex is internal and shall not be used.
100+ func (s * Sampler ) Lock () {
101+ s .mu .Lock ()
102+ }
103+
104+ // TryLock attempts to lock the Sampler for concurrent use.
105+ // Deprecated: mutex is internal and shall not be used.
106+ func (s * Sampler ) TryLock () bool {
107+ return s .mu .TryLock ()
108+ }
109+
110+ // Unlock is used to unlock the Sampler for concurrent use.
111+ // Deprecated: mutex is internal and shall not be used.
112+ func (s * Sampler ) Unlock () {
113+ s .mu .Unlock ()
114+ }
115+
98116// ShouldSample returns a sampling choice based on the passed sampling
99117// parameters.
100118func (s * Sampler ) ShouldSample (p trace.SamplingParameters ) trace.SamplingResult {
You can’t perform that action at this time.
0 commit comments