| 89 | }; |
| 90 | |
| 91 | void 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 | |
| 98 | void* first_get_bthread_singleton(void*) { |
| 99 | g_bthread_started = true; |
no test coverage detected