Class ScopedThreadValue<T>
java.lang.Object
io.opentelemetry.instrumentation.api.internal.ScopedThreadValue<T>
Thread-local state for a lexical scope.
Each call to set(T) must be paired with restore(T) using the value returned by
set, including when the scoped operation throws.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ScopedThreadValue
public ScopedThreadValue()
-
-
Method Details
-
get
-
set
Sets the current value and returns the previous value to pass torestore(T)when the scope ends. -
restore
-