public Scope activate()

in geronimo-opentracing-common/src/main/java/org/apache/geronimo/microprofile/opentracing/common/impl/ScopeManagerImpl.java [29:39]


    public Scope activate(final Span span, final boolean finishSpanOnClose) {
        final Thread thread = Thread.currentThread();
        final Scope oldScope = current.get();
        final ScopeImpl newScope = new ScopeImpl(() -> {
            if (Thread.currentThread() == thread) {
                current.set(oldScope);
            } // else error?
        }, span, finishSpanOnClose);
        current.set(newScope);
        return newScope;
    }