OLD | NEW |
1 // Copyright (c) 2006-2008 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/thread_collision_warner.h" | 5 #include "base/threading/thread_collision_warner.h" |
6 | 6 |
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 | 9 |
10 namespace base { | 10 namespace base { |
11 | 11 |
12 void DCheckAsserter::warn() { | 12 void DCheckAsserter::warn() { |
13 NOTREACHED() << "Thread Collision"; | 13 NOTREACHED() << "Thread Collision"; |
14 } | 14 } |
15 | 15 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 subtle::NoBarrier_AtomicIncrement(&counter_, 1); | 55 subtle::NoBarrier_AtomicIncrement(&counter_, 1); |
56 } | 56 } |
57 | 57 |
58 void ThreadCollisionWarner::Leave() { | 58 void ThreadCollisionWarner::Leave() { |
59 if (subtle::Barrier_AtomicIncrement(&counter_, -1) == 0) { | 59 if (subtle::Barrier_AtomicIncrement(&counter_, -1) == 0) { |
60 subtle::NoBarrier_Store(&valid_thread_id_, 0); | 60 subtle::NoBarrier_Store(&valid_thread_id_, 0); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 } // namespace base | 64 } // namespace base |
OLD | NEW |