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

Function print_func

test/bthread_cond_bug_unittest.cpp:50–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48ProducerStat g_stat[PRODUCER_NUM];
49
50void* print_func(void* arg) {
51 int last_loop[PRODUCER_NUM] = {0};
52 for (int j = 0; j < 10; j++) {
53 usleep(1000000);
54 for (int i = 0; i < PRODUCER_NUM; i++) {
55 if (g_stat[i].loop_count.load() <= last_loop[i]) {
56 LOG(ERROR) << "producer thread:" << i << " stopped";
57 return nullptr;
58 }
59 LOG(INFO) << "producer stat idx:" << i
60 << " wait:" << g_stat[i].wait_count
61 << " wait_timeout:" << g_stat[i].wait_timeout_count
62 << " wait_success:" << g_stat[i].wait_success_count;
63 g_stat[i].loop_count = g_stat[i].loop_count.load();
64 }
65 }
66 return (void*)1;
67}
68
69void* produce_func(void* arg) {
70 const int64_t wait_us = FLAGS_wait_us;

Callers 1

TESTFunction · 0.85

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected