Closed MikeGoldsmith closed 5 years ago
@yurishkuro do you know where the ticket you're referencing is? I'm unfamiliar with it.
@yurishkuro doesn't the synchronized keyword on registerIfAbsent
ensure both the tracer and boolean are updated in a thread-safe way?
@MikeGoldsmith GitHib mobile wasn't showing that part - looks good.
@sjoerdtalsma Sorry for the delay in addressing your comments.
I've updated resetGlobalTracer
and setGlobalTracerUnconditionally
to correctly manage the isRegistered property.
Hey @MikeGoldsmith
Left a comment but overall this looks good ;)
I think discarding the boolean (as it's just state) and replacing that with an ==
comparison with a unique no-op constant tracer gets you what you want (ability to set the NoopTracer) and reduces the complexity of your solution.
I won't object this PR though.
Ported from C# fix where the bug was originally reported in opentracing/opentracing-csharp#113