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

Method AddRefManually

src/butil/shared_object.h:44–45  ·  view source on GitHub ↗

Add ref and returns the ref_count seen before added. The effect is basically same as butil::intrusive_ptr (obj).detach() except that the latter one does not return the seen ref_count which is useful in some scenarios.

Source from the content-addressed store, hash-verified

42 // except that the latter one does not return the seen ref_count which is
43 // useful in some scenarios.
44 int AddRefManually()
45 { return _nref.fetch_add(1, butil::memory_order_relaxed); }
46
47 // Remove one ref, if the ref_count hit zero, delete this object.
48 // Same as butil::intrusive_ptr<T>(obj, false).reset(NULL)

Callers 2

SignalTraceMethod · 0.45
intrusive_ptr_add_refFunction · 0.45

Calls 1

fetch_addMethod · 0.80

Tested by

no test coverage detected