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

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

Issue 9121034: Make DFAKE_MUTEX a typedef when using NDEBUG, so that pedantic compilers don't warn about an extra … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback Created 8 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 | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_THREADING_THREAD_COLLISION_WARNER_H_ 5 #ifndef BASE_THREADING_THREAD_COLLISION_WARNER_H_
6 #define BASE_THREADING_THREAD_COLLISION_WARNER_H_ 6 #define BASE_THREADING_THREAD_COLLISION_WARNER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // Asserts the call is never called simultaneously in two threads. Used at 112 // Asserts the call is never called simultaneously in two threads. Used at
113 // member function scope. Same as DFAKE_SCOPED_LOCK but allows recursive locks. 113 // member function scope. Same as DFAKE_SCOPED_LOCK but allows recursive locks.
114 #define DFAKE_SCOPED_RECURSIVE_LOCK(obj) \ 114 #define DFAKE_SCOPED_RECURSIVE_LOCK(obj) \
115 base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj) 115 base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj)
116 // Asserts the code is always executed in the same thread. 116 // Asserts the code is always executed in the same thread.
117 #define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) \ 117 #define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) \
118 base::ThreadCollisionWarner::Check check_##obj(&obj) 118 base::ThreadCollisionWarner::Check check_##obj(&obj)
119 119
120 #else 120 #else
121 121
122 #define DFAKE_MUTEX(obj) 122 #define DFAKE_MUTEX(obj) typedef void InternalFakeMutexType##obj
123 #define DFAKE_SCOPED_LOCK(obj) ((void)0) 123 #define DFAKE_SCOPED_LOCK(obj) ((void)0)
124 #define DFAKE_SCOPED_RECURSIVE_LOCK(obj) ((void)0) 124 #define DFAKE_SCOPED_RECURSIVE_LOCK(obj) ((void)0)
125 #define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) ((void)0) 125 #define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) ((void)0)
126 126
127 #endif 127 #endif
128 128
129 namespace base { 129 namespace base {
130 130
131 // The class ThreadCollisionWarner uses an Asserter to notify the collision 131 // The class ThreadCollisionWarner uses an Asserter to notify the collision
132 // AsserterBase is the interfaces and DCheckAsserter is the default asserter 132 // AsserterBase is the interfaces and DCheckAsserter is the default asserter
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // Here only for class unit tests purpose, during the test I need to not 236 // Here only for class unit tests purpose, during the test I need to not
237 // DCHECK but notify the collision with something else. 237 // DCHECK but notify the collision with something else.
238 AsserterBase* asserter_; 238 AsserterBase* asserter_;
239 239
240 DISALLOW_COPY_AND_ASSIGN(ThreadCollisionWarner); 240 DISALLOW_COPY_AND_ASSIGN(ThreadCollisionWarner);
241 }; 241 };
242 242
243 } // namespace base 243 } // namespace base
244 244
245 #endif // BASE_THREADING_THREAD_COLLISION_WARNER_H_ 245 #endif // BASE_THREADING_THREAD_COLLISION_WARNER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698