17 #include <type_traits> 53 while (*state ==
false) {
81 mutex = &default_mutex;
84 condvar = &default_condvar;
87 std::thread thread_one(ThreadOne, mutex, condvar, ¬ification, &state);
88 std::thread thread_two(ThreadTwo, mutex, condvar, ¬ification, &state);
96 RunTests(&mutex, &condvar);
101 void TestConstInitGlobal() { RunTests(&const_init_mutex,
nullptr); }
110 using Function = void (*)();
112 class OnConstruction {
114 explicit OnConstruction(Function fn) { fn(); }
117 class OnDestruction {
119 explicit OnDestruction(Function fn) : fn_(fn) {}
120 ~OnDestruction() { fn_(); }
132 OnConstruction test_early_const_init([] {
133 RunTests(&early_const_init_mutex,
nullptr);
147 const_init_sanity_mutex.
Lock();
152 const_init_sanity_mutex.
Unlock();
162 OnDestruction test_late_const_init([] {
163 RunTests(&late_const_init_mutex,
nullptr);
171 TestConstInitGlobal();
bool HasBeenNotified() const
#define ABSL_RAW_CHECK(condition, message)
void Unlock() UNLOCK_FUNCTION()
void WaitForNotification() const
void AssertHeld() const ASSERT_EXCLUSIVE_LOCK()
#define NO_THREAD_SAFETY_ANALYSIS
void Lock() EXCLUSIVE_LOCK_FUNCTION()