about summary refs log tree commit diff
path: root/absl/base/call_once_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/base/call_once_test.cc')
-rw-r--r--absl/base/call_once_test.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/absl/base/call_once_test.cc b/absl/base/call_once_test.cc
index aa7eb95db262..183b92efa329 100644
--- a/absl/base/call_once_test.cc
+++ b/absl/base/call_once_test.cc
@@ -19,6 +19,7 @@
 
 #include "gtest/gtest.h"
 #include "absl/base/attributes.h"
+#include "absl/base/const_init.h"
 #include "absl/base/thread_annotations.h"
 #include "absl/synchronization/mutex.h"
 
@@ -26,7 +27,8 @@ namespace absl {
 namespace {
 
 absl::once_flag once;
-Mutex counters_mu;
+
+ABSL_CONST_INIT Mutex counters_mu(absl::kConstInit);
 
 int running_thread_count GUARDED_BY(counters_mu) = 0;
 int call_once_invoke_count GUARDED_BY(counters_mu) = 0;