| 69 | } |
| 70 | |
| 71 | void 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 | |
| 82 | std::shared_ptr<Span> GetTlsParentSpan() { |
| 83 | using namespace bthread; |