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

Method remove

src/butil/thread_local.cpp:58–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56 }
57
58 void remove(Fn fn, void* arg) {
59 std::vector<Pair>::iterator
60 it = std::find(_fns.begin(), _fns.end(), std::make_pair(fn, arg));
61 if (it != _fns.end()) {
62 std::vector<Pair>::iterator ite = it + 1;
63 for (; ite != _fns.end() && ite->first == fn && ite->second == arg;
64 ++ite) {}
65 _fns.erase(it, ite);
66 }
67 }
68
69private:
70 std::vector<Pair> _fns;

Callers 1

thread_atexit_cancelFunction · 0.80

Calls 4

findFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected