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

Side by Side Diff: base/lock_impl_win.cc

Issue 42402: Test was examining a variable without first acquiring a required Lock.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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/lock_impl.h ('k') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/lock_impl.h" 5 #include "base/lock_impl.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 7
8 // NOTE: Although windows critical sections support recursive locks, we do not 8 // NOTE: Although windows critical sections support recursive locks, we do not
9 // allow this, and we will commonly fire a DCHECK() if a thread attempts to 9 // allow this, and we will commonly fire a DCHECK() if a thread attempts to
10 // acquire the lock a second time (while already holding it). 10 // acquire the lock a second time (while already holding it).
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #ifndef NDEBUG 59 #ifndef NDEBUG
60 --recursion_count_shadow_; // ONLY access while lock is still held. 60 --recursion_count_shadow_; // ONLY access while lock is still held.
61 DCHECK(0 <= recursion_count_shadow_); 61 DCHECK(0 <= recursion_count_shadow_);
62 owning_thread_id_ = 0; 62 owning_thread_id_ = 0;
63 #endif // NDEBUG 63 #endif // NDEBUG
64 ::LeaveCriticalSection(&os_lock_); 64 ::LeaveCriticalSection(&os_lock_);
65 } 65 }
66 66
67 // In non-debug builds, this method is declared as an empty inline method. 67 // In non-debug builds, this method is declared as an empty inline method.
68 #ifndef NDEBUG 68 #ifndef NDEBUG
69 void LockImpl::AssertAcquired() { 69 void LockImpl::AssertAcquired() const {
70 DCHECK(recursion_count_shadow_ > 0); 70 DCHECK(recursion_count_shadow_ > 0);
71 DCHECK_EQ(owning_thread_id_, PlatformThread::CurrentId()); 71 DCHECK_EQ(owning_thread_id_, PlatformThread::CurrentId());
72 } 72 }
73 #endif 73 #endif
OLDNEW
« no previous file with comments | « base/lock_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698