17 #include <type_traits>
19 #include "absl/base/attributes.h"
20 #include "absl/base/const_init.h"
21 #include "absl/base/internal/raw_logging.h"
22 #include "absl/base/thread_annotations.h"
23 #include "absl/synchronization/mutex.h"
24 #include "absl/synchronization/notification.h"
53 while (*
state ==
false) {
81 mutex = &default_mutex;
101 void TestConstInitGlobal() { RunTests(&const_init_mutex,
nullptr); }
112 class OnConstruction {
117 class OnDestruction {
120 ~OnDestruction() { fn_(); }
129 #if defined(__clang__) || !(defined(_MSC_VER) && _MSC_VER > 1900)
137 OnConstruction test_early_const_init([] {
138 RunTests(&early_const_init_mutex,
nullptr);
152 const_init_sanity_mutex.
Lock();
157 const_init_sanity_mutex.
Unlock();
159 #endif // defined(__clang__) || !(defined(_MSC_VER) && _MSC_VER > 1900)
168 OnDestruction test_late_const_init([] {
169 RunTests(&late_const_init_mutex,
nullptr);
177 TestConstInitGlobal();