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

Unified Diff: webrtc/base/race_checker.h

Issue 2877023002: Move webrtc/{base => rtc_base} (Closed)
Patch Set: update presubmit.py and DEPS include rules Created 3 years, 6 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 | « webrtc/base/ptr_util_unittest.cc ('k') | webrtc/base/race_checker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/race_checker.h
diff --git a/webrtc/base/race_checker.h b/webrtc/base/race_checker.h
index a6ba771f90c212b9b5ef64253b5d78501b2f2656..474fdb59ba78e1222acfc3079dcc448df304f072 100644
--- a/webrtc/base/race_checker.h
+++ b/webrtc/base/race_checker.h
@@ -11,68 +11,9 @@
#ifndef WEBRTC_BASE_RACE_CHECKER_H_
#define WEBRTC_BASE_RACE_CHECKER_H_
-#include "webrtc/base/checks.h"
-#include "webrtc/base/platform_thread.h"
-#include "webrtc/base/thread_annotations.h"
-namespace rtc {
-
-namespace internal {
-class RaceCheckerScope;
-} // namespace internal
-
-// Best-effort race-checking implementation. This primitive uses no
-// synchronization at all to be as-fast-as-possible in the non-racy case.
-class LOCKABLE RaceChecker {
- public:
- friend class internal::RaceCheckerScope;
- RaceChecker();
-
- private:
- bool Acquire() const EXCLUSIVE_LOCK_FUNCTION();
- void Release() const UNLOCK_FUNCTION();
-
- // Volatile to prevent code being optimized away in Acquire()/Release().
- mutable volatile int access_count_ = 0;
- mutable volatile PlatformThreadRef accessing_thread_;
-};
-
-namespace internal {
-class SCOPED_LOCKABLE RaceCheckerScope {
- public:
- explicit RaceCheckerScope(const RaceChecker* race_checker)
- EXCLUSIVE_LOCK_FUNCTION(race_checker);
-
- bool RaceDetected() const;
- ~RaceCheckerScope() UNLOCK_FUNCTION();
-
- private:
- const RaceChecker* const race_checker_;
- const bool race_check_ok_;
-};
-
-class SCOPED_LOCKABLE RaceCheckerScopeDoNothing {
- public:
- explicit RaceCheckerScopeDoNothing(const RaceChecker* race_checker)
- EXCLUSIVE_LOCK_FUNCTION(race_checker) {}
-
- ~RaceCheckerScopeDoNothing() UNLOCK_FUNCTION() {}
-};
-
-} // namespace internal
-} // namespace rtc
-
-#define RTC_CHECK_RUNS_SERIALIZED(x) \
- rtc::internal::RaceCheckerScope race_checker(x); \
- RTC_CHECK(!race_checker.RaceDetected())
-
-#if RTC_DCHECK_IS_ON
-#define RTC_DCHECK_RUNS_SERIALIZED(x) \
- rtc::internal::RaceCheckerScope race_checker(x); \
- RTC_DCHECK(!race_checker.RaceDetected())
-#else
-#define RTC_DCHECK_RUNS_SERIALIZED(x) \
- rtc::internal::RaceCheckerScopeDoNothing race_checker(x)
-#endif
+// This header is deprecated and is just left here temporarily during
+// refactoring. See https://bugs.webrtc.org/7634 for more details.
+#include "webrtc/rtc_base/race_checker.h"
#endif // WEBRTC_BASE_RACE_CHECKER_H_
« no previous file with comments | « webrtc/base/ptr_util_unittest.cc ('k') | webrtc/base/race_checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698