MCPcopy Create free account
hub / github.com/baidu/babylon / TEST

Function TEST

test/concurrent/test_thread_local.cpp:12–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using ::babylon::EnumerableThreadLocal;
11
12TEST(thread_local_storage, each_live_thread_has_separate_local_storage) {
13 EnumerableThreadLocal<::std::string> storage;
14 auto* v1 = &storage.local();
15 ::std::thread([&] {
16 ASSERT_NE(v1, &storage.local());
17 }).join();
18}
19
20TEST(thread_local_storage, new_thread_may_reuse_storage) {
21 EnumerableThreadLocal<::std::string> storage;

Callers

nothing calls this directly

Calls 12

localMethod · 0.80
emplace_backMethod · 0.80
get_futureMethod · 0.80
loadMethod · 0.80
set_valueMethod · 0.80
for_each_aliveMethod · 0.80
joinMethod · 0.45
resizeMethod · 0.45
reserveMethod · 0.45
getMethod · 0.45
for_eachMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected