Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2684)

Unified Diff: base/synchronization/atomic_flag.cc

Issue 2163753004: Rename CancellationFlag to AtomicFlag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix dcheck death test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/synchronization/atomic_flag.h ('k') | base/synchronization/atomic_flag_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « base/synchronization/atomic_flag.h ('k') | base/synchronization/atomic_flag_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698