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

Side by Side Diff: base/threading/thread_checker_impl.cc

Issue 9020008: Enable ThreadChecker in non-debug builds if DCHECK_ALWAYS_ON is (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsEnabled function, use in one test. Created 9 years 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
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 #include "base/threading/thread_checker_impl.h" 5 #include "base/threading/thread_checker_impl.h"
6 6
7 namespace base { 7 namespace base {
8 8
9 ThreadCheckerImpl::ThreadCheckerImpl() 9 ThreadCheckerImpl::ThreadCheckerImpl()
10 : valid_thread_id_(kInvalidThreadId) { 10 : valid_thread_id_(kInvalidThreadId) {
(...skipping 13 matching lines...) Expand all
24 valid_thread_id_ = kInvalidThreadId; 24 valid_thread_id_ = kInvalidThreadId;
25 } 25 }
26 26
27 void ThreadCheckerImpl::EnsureThreadIdAssigned() const { 27 void ThreadCheckerImpl::EnsureThreadIdAssigned() const {
28 AutoLock auto_lock(lock_); 28 AutoLock auto_lock(lock_);
29 if (valid_thread_id_ != kInvalidThreadId) 29 if (valid_thread_id_ != kInvalidThreadId)
30 return; 30 return;
31 valid_thread_id_ = PlatformThread::CurrentId(); 31 valid_thread_id_ = PlatformThread::CurrentId();
32 } 32 }
33 33
34 // static
35 bool ThreadCheckerImpl::IsEnabled() {
36 return true;
37 }
38
34 } // namespace base 39 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698