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

Method AddStream

src/brpc/socket.cpp:2537–2549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2535}
2536
2537int Socket::AddStream(StreamId stream_id) {
2538 _stream_mutex.lock();
2539 if (Failed()) {
2540 _stream_mutex.unlock();
2541 return -1;
2542 }
2543 if (_stream_set == NULL) {
2544 _stream_set = new std::set<StreamId>();
2545 }
2546 _stream_set->insert(stream_id);
2547 _stream_mutex.unlock();
2548 return 0;
2549}
2550
2551int Socket::RemoveStream(StreamId stream_id) {
2552 _stream_mutex.lock();

Callers 1

SetHostSocketMethod · 0.80

Calls 3

lockMethod · 0.45
unlockMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected