diff --git a/brave/README.md b/brave/README.md
index df2699ce7d..2303b79307 100644
--- a/brave/README.md
+++ b/brave/README.md
@@ -374,6 +374,10 @@ least concerns this way. This approach is only possible due to the Recorder
architecture, which allows different span instances with the same trace
context to mutate the same shared state.
+The first design of `DefaultSpanScoper` included code from Eirik
+Sletteberg's [ContinuationLocal](https://github.com/DistributedTracing/continuation-local-storage-jvm/pull/1)
+draft, which is a dependency-free port of `com.twitter.util.Local`.
+
### Public namespace
Brave 4's pubic namespace is more defensive that the past, using a package
accessor design from [OkHttp](https://github.com/square/okhttp).
diff --git a/brave/src/main/java/brave/Tracer.java b/brave/src/main/java/brave/Tracer.java
index 8eda183844..1472353b7a 100644
--- a/brave/src/main/java/brave/Tracer.java
+++ b/brave/src/main/java/brave/Tracer.java
@@ -10,6 +10,7 @@
import brave.propagation.TraceContext;
import brave.propagation.TraceContextOrSamplingFlags;
import brave.sampler.Sampler;
+import java.util.concurrent.atomic.AtomicInteger;
import zipkin.Endpoint;
import zipkin.reporter.AsyncReporter;
import zipkin.reporter.Reporter;
@@ -317,19 +318,51 @@ public SpanScoper.SpanInScope withSpan(Span span) {
return currentContext != null ? toSpan(currentContext) : null;
}
- /** Default implementation which is backed by a thread local */
+ /**
+ * Default implementation which is backed by a thread local
+ *
+ *
This is based on com.twitter.util.Local port named ContinuationLocal written by Eirik
+ * Sletteberg
+ */
static final class DefaultSpanScoper implements SpanScoper {
- // TODO: make this implementation more realistic
- final ThreadLocal localSpan = new ThreadLocal<>();
+ static final InheritableThreadLocal