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

Side by Side Diff: base/synchronization/condition_variable_win.cc

Issue 23753006: base: Rename OSLockType to NativeHandle in Lock API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/synchronization/condition_variable_posix.cc ('k') | base/synchronization/lock_impl.h » ('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) 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/synchronization/condition_variable.h" 5 #include "base/synchronization/condition_variable.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <stack> 8 #include <stack>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 DCHECK(user_lock); 90 DCHECK(user_lock);
91 } 91 }
92 92
93 void WinVistaCondVar::Wait() { 93 void WinVistaCondVar::Wait() {
94 TimedWait(TimeDelta::FromMilliseconds(INFINITE)); 94 TimedWait(TimeDelta::FromMilliseconds(INFINITE));
95 } 95 }
96 96
97 void WinVistaCondVar::TimedWait(const TimeDelta& max_time) { 97 void WinVistaCondVar::TimedWait(const TimeDelta& max_time) {
98 base::ThreadRestrictions::AssertWaitAllowed(); 98 base::ThreadRestrictions::AssertWaitAllowed();
99 DWORD timeout = static_cast<DWORD>(max_time.InMilliseconds()); 99 DWORD timeout = static_cast<DWORD>(max_time.InMilliseconds());
100 CRITICAL_SECTION* cs = user_lock_.lock_.os_lock(); 100 CRITICAL_SECTION* cs = user_lock_.lock_.native_handle();
101 101
102 #if !defined(NDEBUG) 102 #if !defined(NDEBUG)
103 user_lock_.CheckHeldAndUnmark(); 103 user_lock_.CheckHeldAndUnmark();
104 #endif 104 #endif
105 105
106 if (FALSE == sleep_condition_variable_fn(&cv_, cs, timeout)) { 106 if (FALSE == sleep_condition_variable_fn(&cv_, cs, timeout)) {
107 DCHECK(GetLastError() != WAIT_TIMEOUT); 107 DCHECK(GetLastError() != WAIT_TIMEOUT);
108 } 108 }
109 109
110 #if !defined(NDEBUG) 110 #if !defined(NDEBUG)
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 660
661 void ConditionVariable::Broadcast() { 661 void ConditionVariable::Broadcast() {
662 impl_->Broadcast(); 662 impl_->Broadcast();
663 } 663 }
664 664
665 void ConditionVariable::Signal() { 665 void ConditionVariable::Signal() {
666 impl_->Signal(); 666 impl_->Signal();
667 } 667 }
668 668
669 } // namespace base 669 } // namespace base
OLDNEW
« no previous file with comments | « base/synchronization/condition_variable_posix.cc ('k') | base/synchronization/lock_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698