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

Function SetTlsParentSpan

src/brpc/span.cpp:71–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void SetTlsParentSpan(std::shared_ptr<Span> span) {
72 using namespace bthread;
73 LocalStorage ls = BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_bls);
74 if (ls.rpcz_parent_span) {
75 *static_cast<std::weak_ptr<Span>*>(ls.rpcz_parent_span) = span;
76 } else {
77 ls.rpcz_parent_span = new std::weak_ptr<Span>(span);
78 BAIDU_SET_VOLATILE_THREAD_LOCAL(tls_bls, ls);
79 }
80}
81
82std::shared_ptr<Span> GetTlsParentSpan() {
83 using namespace bthread;

Callers 1

AsParentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected