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

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

Issue 6410105: run iwyu on base! Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: Created 9 years, 10 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/thread_checker.cc ('k') | base/threading/thread_local_posix.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 #include "base/threading/thread_collision_warner.h" 5 #include "base/atomicops.h"
6 6 #include "base/atomicops_internals_x86_macosx.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
9 #include "base/threading/thread_collision_warner.h"
9 10
10 namespace base { 11 namespace base {
11 12
12 void DCheckAsserter::warn() { 13 void DCheckAsserter::warn() {
13 NOTREACHED() << "Thread Collision"; 14 NOTREACHED() << "Thread Collision";
14 } 15 }
15 16
16 static subtle::Atomic32 CurrentThread() { 17 static subtle::Atomic32 CurrentThread() {
17 const PlatformThreadId current_thread_id = PlatformThread::CurrentId(); 18 const PlatformThreadId current_thread_id = PlatformThread::CurrentId();
18 // We need to get the thread id into an atomic data type. This might be a 19 // We need to get the thread id into an atomic data type. This might be a
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 subtle::NoBarrier_AtomicIncrement(&counter_, 1); 56 subtle::NoBarrier_AtomicIncrement(&counter_, 1);
56 } 57 }
57 58
58 void ThreadCollisionWarner::Leave() { 59 void ThreadCollisionWarner::Leave() {
59 if (subtle::Barrier_AtomicIncrement(&counter_, -1) == 0) { 60 if (subtle::Barrier_AtomicIncrement(&counter_, -1) == 0) {
60 subtle::NoBarrier_Store(&valid_thread_id_, 0); 61 subtle::NoBarrier_Store(&valid_thread_id_, 0);
61 } 62 }
62 } 63 }
63 64
64 } // namespace base 65 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/thread_checker.cc ('k') | base/threading/thread_local_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698