| 80 | } |
| 81 | |
| 82 | std::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 | |
| 93 | void ClearTlsParentSpan() { |
| 94 | using namespace bthread; |
no test coverage detected