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

Function ThreadLocalStorageCleanup

test/thread_local_storage_unittest.cc:60–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59
60void ThreadLocalStorageCleanup(void *value) {
61 int *ptr = reinterpret_cast<int*>(value);
62 // Destructors should never be called with a NULL.
63 ASSERT_NE(reinterpret_cast<int*>(NULL), ptr);
64 if (*ptr == kFinalTlsValue)
65 return; // We've been called enough times.
66 ASSERT_LT(kFinalTlsValue, *ptr);
67 ASSERT_GE(kFinalTlsValue + kNumberDestructorCallRepetitions, *ptr);
68 --*ptr; // Move closer to our target.
69 // Tell tls that we're not done with this thread, and still need destruction.
70 tls_slot.Set(value);
71}
72
73} // namespace
74

Callers

nothing calls this directly

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected