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

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

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 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
« no previous file with comments | « base/strings/utf_string_conversions_unittest.cc ('k') | base/sys_info.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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 // Free list for old events. 199 // Free list for old events.
200 Event recycling_list_; 200 Event recycling_list_;
201 int recycling_list_size_; 201 int recycling_list_size_;
202 202
203 // The number of allocated, but not yet deleted events. 203 // The number of allocated, but not yet deleted events.
204 int allocation_counter_; 204 int allocation_counter_;
205 }; 205 };
206 206
207 WinXPCondVar::WinXPCondVar(Lock* user_lock) 207 WinXPCondVar::WinXPCondVar(Lock* user_lock)
208 : user_lock_(*user_lock), 208 : run_state_(RUNNING),
209 run_state_(RUNNING), 209 user_lock_(*user_lock),
210 allocation_counter_(0), 210 recycling_list_size_(0),
211 recycling_list_size_(0) { 211 allocation_counter_(0) {
212 DCHECK(user_lock); 212 DCHECK(user_lock);
213 } 213 }
214 214
215 WinXPCondVar::~WinXPCondVar() { 215 WinXPCondVar::~WinXPCondVar() {
216 AutoLock auto_lock(internal_lock_); 216 AutoLock auto_lock(internal_lock_);
217 run_state_ = SHUTDOWN; // Prevent any more waiting. 217 run_state_ = SHUTDOWN; // Prevent any more waiting.
218 218
219 DCHECK_EQ(recycling_list_size_, allocation_counter_); 219 DCHECK_EQ(recycling_list_size_, allocation_counter_);
220 if (recycling_list_size_ != allocation_counter_) { // Rare shutdown problem. 220 if (recycling_list_size_ != allocation_counter_) { // Rare shutdown problem.
221 // There are threads of execution still in this->TimedWait() and yet the 221 // There are threads of execution still in this->TimedWait() and yet the
(...skipping 438 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/strings/utf_string_conversions_unittest.cc ('k') | base/sys_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698