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

Function get_bthread_singleton

test/bthread_once_unittest.cpp:91–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89};
90
91void get_bthread_singleton() {
92 auto instance = bthread::get_leaky_singleton<BthreadSingleton>();
93 ASSERT_NE(nullptr, instance);
94 // Only one BthreadSingleton instance has been created.
95 ASSERT_EQ(1, g_bthread_singleton_count.load(butil::memory_order_relaxed));
96}
97
98void* first_get_bthread_singleton(void*) {
99 g_bthread_started = true;

Callers 2

TESTFunction · 0.85

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected