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

Unified Diff: base/threading/non_thread_safe.h

Issue 2869893003: New Sequence/Thread checking API. (Closed)
Patch Set: fix tests in non-dcheck builds, need fixture can't use lambdas Created 3 years, 7 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/sequence_checker_unittest.cc ('k') | base/threading/thread_checker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/non_thread_safe.h
diff --git a/base/threading/non_thread_safe.h b/base/threading/non_thread_safe.h
index 64ae8e4da9fd090eee9d134479fb4d2c5659008a..407b2e1f924069c0aa9b1d07306e6bcb093124b7 100644
--- a/base/threading/non_thread_safe.h
+++ b/base/threading/non_thread_safe.h
@@ -30,27 +30,10 @@ class NonThreadSafeDoNothing {
void DetachFromThread() {}
};
-// NonThreadSafe is a helper class used to help verify that methods of a
-// class are called from the same thread. One can inherit from this class
-// and use CalledOnValidThread() to verify.
-//
-// This is intended to be used with classes that appear to be thread safe, but
-// aren't. For example, a service or a singleton like the preferences system.
-//
-// Example:
-// class MyClass : public base::NonThreadSafe {
-// public:
-// void Foo() {
-// DCHECK(CalledOnValidThread());
-// ... (do stuff) ...
-// }
-// }
-//
-// Note that base::ThreadChecker offers identical functionality to
-// NonThreadSafe, but does not require inheritance. In general, it is preferable
-// to have a base::ThreadChecker as a member, rather than inherit from
-// NonThreadSafe. For more details about when to choose one over the other, see
-// the documentation for base::ThreadChecker.
+// DEPRECATED! Use base::SequenceChecker (for thread-safety) or
+// base::ThreadChecker (for thread-affinity) -- see their documentation for
+// details. Use a checker as a protected member instead of inheriting from
+// NonThreadSafe if you need subclasses to have access.
#if DCHECK_IS_ON()
typedef NonThreadSafeImpl NonThreadSafe;
#else
« no previous file with comments | « base/sequence_checker_unittest.cc ('k') | base/threading/thread_checker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698