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

Side by Side Diff: base/threading/thread_checker.h

Issue 6001010: Move platform_thread to base/threading and put in the base namespace. I left ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/threading/simple_thread.cc ('k') | base/threading/thread_checker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_THREAD_CHECKER_H_ 5 #ifndef BASE_THREADING_THREAD_CHECKER_H_
6 #define BASE_THREAD_CHECKER_H_ 6 #define BASE_THREADING_THREAD_CHECKER_H_
7 #pragma once 7 #pragma once
8 8
9 #ifndef NDEBUG 9 #ifndef NDEBUG
10 #include "base/lock.h" 10 #include "base/lock.h"
11 #include "base/platform_thread.h" 11 #include "base/threading/platform_thread.h"
12 #endif // NDEBUG 12 #endif // NDEBUG
13 13
14 namespace base {
15
14 // Before using this class, please consider using NonThreadSafe as it 16 // Before using this class, please consider using NonThreadSafe as it
15 // makes it much easier to determine the nature of your class. 17 // makes it much easier to determine the nature of your class.
16 // 18 //
17 // A helper class used to help verify that some methods of a class are 19 // A helper class used to help verify that some methods of a class are
18 // called from the same thread. One can inherit from this class and use 20 // called from the same thread. One can inherit from this class and use
19 // CalledOnValidThread() to verify. 21 // CalledOnValidThread() to verify.
20 // 22 //
21 // Inheriting from class indicates that one must be careful when using the class 23 // Inheriting from class indicates that one must be careful when using the class
22 // with multiple threads. However, it is up to the class document to indicate 24 // with multiple threads. However, it is up to the class document to indicate
23 // how it can be used with threads. 25 // how it can be used with threads.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 class ThreadChecker { 61 class ThreadChecker {
60 public: 62 public:
61 bool CalledOnValidThread() const { 63 bool CalledOnValidThread() const {
62 return true; 64 return true;
63 } 65 }
64 66
65 void DetachFromThread() {} 67 void DetachFromThread() {}
66 }; 68 };
67 #endif // NDEBUG 69 #endif // NDEBUG
68 70
69 #endif // BASE_THREAD_CHECKER_H_ 71 } // namespace base
72
73 #endif // BASE_THREADING_THREAD_CHECKER_H_
OLDNEW
« no previous file with comments | « base/threading/simple_thread.cc ('k') | base/threading/thread_checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698