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

Function worker

test/brpc_socket_map_unittest.cpp:39–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37brpc::SocketMapKey g_key(g_endpoint);
38
39void* worker(void*) {
40 const int ROUND = 2;
41 const int COUNT = 1000;
42 brpc::SocketId id;
43 for (int i = 0; i < ROUND * 2; ++i) {
44 for (int j = 0; j < COUNT; ++j) {
45 if (i % 2 == 0) {
46 EXPECT_EQ(0, brpc::SocketMapInsert(g_key, &id));
47 } else {
48 brpc::SocketMapRemove(g_key);
49 }
50 }
51 }
52 return NULL;
53}
54
55class SocketMapTest : public ::testing::Test{
56protected:

Callers

nothing calls this directly

Calls 2

SocketMapRemoveFunction · 0.85
SocketMapInsertFunction · 0.50

Tested by

no test coverage detected