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

Method info

src/brpc/span.h:195–198  ·  view source on GitHub ↗

Returns a copy instead of a reference for thread safety. Current usage: Only called by Span2Proto() which immediately passes the result to protobuf's set_info(). In this specific scenario, returning a reference would also be safe because set_info() copies the string before the reference could be invalidated by concurrent Annotate() calls. However, returning by value is more robust: it prevents p

Source from the content-addressed store, hash-verified

193 // future code holds the reference longer, and has no performance penalty due to
194 // C++11 move semantics (the temporary is moved, not copied, into protobuf).
195 std::string info() const {
196 BAIDU_SCOPED_LOCK(_info_spinlock);
197 return _info;
198 }
199
200private:
201 DISALLOW_COPY_AND_ASSIGN(Span);

Callers 4

Span2ProtoFunction · 0.80
PrintClientSpanFunction · 0.80
PrintBthreadSpanFunction · 0.80
PrintServerSpanFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected