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

Function string_appender

test/bvar_reducer_unittest.cpp:287–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285};
286
287static void* string_appender(void* arg) {
288 bvar::Adder<std::string>* cater = (bvar::Adder<std::string>*)arg;
289 int count = 0;
290 std::string id = butil::string_printf("%lld", (long long)pthread_self());
291 std::string tmp = "a";
292 for (count = 0; !count || !g_stop; ++count) {
293 *cater << id << ":";
294 for (char c = 'a'; c <= 'z'; ++c) {
295 tmp[0] = c;
296 *cater << tmp;
297 }
298 *cater << ".";
299 }
300 StringAppenderResult* res = new StringAppenderResult;
301 res->count = count;
302 LOG(INFO) << "Appended " << count;
303 return res;
304}
305
306TEST_F(ReducerTest, non_primitive_mt) {
307 bvar::Adder<std::string> cater;

Callers

nothing calls this directly

Calls 1

string_printfFunction · 0.85

Tested by

no test coverage detected