Index: base/synchronization/atomic_flag.cc |
diff --git a/base/synchronization/cancellation_flag.cc b/base/synchronization/atomic_flag.cc |
similarity index 60% |
rename from base/synchronization/cancellation_flag.cc |
rename to base/synchronization/atomic_flag.cc |
index ca5c0a82837070742e63914f79e57d924721efd4..98d90cb88fd6c039842eb6ac5ccd6bd6017abf9f 100644 |
--- a/base/synchronization/cancellation_flag.cc |
+++ b/base/synchronization/atomic_flag.cc |
@@ -2,24 +2,24 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "base/synchronization/cancellation_flag.h" |
+#include "base/synchronization/atomic_flag.h" |
#include "base/logging.h" |
namespace base { |
-void CancellationFlag::Set() { |
-#if !defined(NDEBUG) |
- DCHECK_EQ(set_on_, PlatformThread::CurrentId()); |
-#endif |
+AtomicFlag::AtomicFlag() = default; |
+ |
+void AtomicFlag::Set() { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
base::subtle::Release_Store(&flag_, 1); |
} |
-bool CancellationFlag::IsSet() const { |
+bool AtomicFlag::IsSet() const { |
return base::subtle::Acquire_Load(&flag_) != 0; |
} |
-void CancellationFlag::UnsafeResetForTesting() { |
+void AtomicFlag::UnsafeResetForTesting() { |
base::subtle::Release_Store(&flag_, 0); |
} |