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

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

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 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
« no previous file with comments | « base/threading/sequenced_worker_pool.cc ('k') | base/threading/thread.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sequenced_worker_pool.h" 5 #include "base/threading/sequenced_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 while (unblock_counter_ == 0) 47 while (unblock_counter_ == 0)
48 cond_var_.Wait(); 48 cond_var_.Wait();
49 unblock_counter_--; 49 unblock_counter_--;
50 } 50 }
51 cond_var_.Signal(); 51 cond_var_.Signal();
52 } 52 }
53 53
54 void Unblock(size_t count) { 54 void Unblock(size_t count) {
55 { 55 {
56 base::AutoLock lock(lock_); 56 base::AutoLock lock(lock_);
57 DCHECK(unblock_counter_ == 0); 57 DCHECK_EQ(unblock_counter_, 0u);
58 unblock_counter_ = count; 58 unblock_counter_ = count;
59 } 59 }
60 cond_var_.Signal(); 60 cond_var_.Signal();
61 } 61 }
62 62
63 private: 63 private:
64 base::Lock lock_; 64 base::Lock lock_;
65 base::ConditionVariable cond_var_; 65 base::ConditionVariable cond_var_;
66 66
67 size_t unblock_counter_; 67 size_t unblock_counter_;
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 SequencedWorkerPoolSequencedTaskRunner, TaskRunnerTest, 955 SequencedWorkerPoolSequencedTaskRunner, TaskRunnerTest,
956 SequencedWorkerPoolSequencedTaskRunnerTestDelegate); 956 SequencedWorkerPoolSequencedTaskRunnerTestDelegate);
957 957
958 INSTANTIATE_TYPED_TEST_CASE_P( 958 INSTANTIATE_TYPED_TEST_CASE_P(
959 SequencedWorkerPoolSequencedTaskRunner, SequencedTaskRunnerTest, 959 SequencedWorkerPoolSequencedTaskRunner, SequencedTaskRunnerTest,
960 SequencedWorkerPoolSequencedTaskRunnerTestDelegate); 960 SequencedWorkerPoolSequencedTaskRunnerTestDelegate);
961 961
962 } // namespace 962 } // namespace
963 963
964 } // namespace base 964 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/sequenced_worker_pool.cc ('k') | base/threading/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698