MCPcopy Create free account
hub / github.com/apache/brpc / GetTlsParentSpan

Function GetTlsParentSpan

src/brpc/span.cpp:82–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82std::shared_ptr<Span> GetTlsParentSpan() {
83 using namespace bthread;
84 LocalStorage ls = BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_bls);
85 if (!ls.rpcz_parent_span) {
86 return nullptr;
87 }
88
89 auto* weak_ptr = static_cast<std::weak_ptr<Span>*>(ls.rpcz_parent_span);
90 return weak_ptr->lock();
91}
92
93void ClearTlsParentSpan() {
94 using namespace bthread;

Callers 4

tls_parentMethod · 0.85
EndAsParentMethod · 0.85
EndBthreadSpanFunction · 0.85
AnnotateSpanFunction · 0.85

Calls 1

lockMethod · 0.45

Tested by

no test coverage detected