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

Method ShareStats

src/brpc/socket.cpp:2714–2722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2712}
2713
2714void Socket::ShareStats(Socket* main_socket) {
2715 SharedPart* main_sp = main_socket->GetOrNewSharedPart();
2716 main_sp->AddRefManually();
2717 SharedPart* my_sp =
2718 _shared_part.exchange(main_sp, butil::memory_order_acq_rel);
2719 if (my_sp) {
2720 my_sp->RemoveRefManually();
2721 }
2722}
2723
2724int Socket::GetPooledSocket(SocketUniquePtr* pooled_socket) {
2725 if (pooled_socket == NULL) {

Callers 3

OnCreatingStreamMethod · 0.80
GetPooledSocketMethod · 0.80
GetShortSocketMethod · 0.80

Calls 4

GetOrNewSharedPartMethod · 0.80
AddRefManuallyMethod · 0.45
exchangeMethod · 0.45
RemoveRefManuallyMethod · 0.45

Tested by

no test coverage detected