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

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

Issue 213363003: Delete some dead code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: brettw Created 6 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/prefs/pref_notifier_impl_unittest.cc ('k') | device/bluetooth/bluetooth_utils.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) 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 // Multi-threaded tests of ConditionVariable class. 5 // Multi-threaded tests of ConditionVariable class.
6 6
7 #include <time.h> 7 #include <time.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 //---------------------------------------------------------------------------- 95 //----------------------------------------------------------------------------
96 // The rest of the methods are for use by the controlling master thread (the 96 // The rest of the methods are for use by the controlling master thread (the
97 // test case code). 97 // test case code).
98 void ResetHistory(); 98 void ResetHistory();
99 int GetMinCompletionsByWorkerThread() const; 99 int GetMinCompletionsByWorkerThread() const;
100 int GetMaxCompletionsByWorkerThread() const; 100 int GetMaxCompletionsByWorkerThread() const;
101 int GetNumThreadsTakingAssignments() const; 101 int GetNumThreadsTakingAssignments() const;
102 int GetNumThreadsCompletingTasks() const; 102 int GetNumThreadsCompletingTasks() const;
103 int GetNumberOfCompletedTasks() const; 103 int GetNumberOfCompletedTasks() const;
104 TimeDelta GetWorkTime() const;
105 104
106 void SetWorkTime(TimeDelta delay); 105 void SetWorkTime(TimeDelta delay);
107 void SetTaskCount(int count); 106 void SetTaskCount(int count);
108 void SetAllowHelp(bool allow); 107 void SetAllowHelp(bool allow);
109 108
110 // The following must be called without locking, and will spin wait until the 109 // The following must be called without locking, and will spin wait until the
111 // threads are all in a wait state. 110 // threads are all in a wait state.
112 void SpinUntilAllThreadsAreWaiting(); 111 void SpinUntilAllThreadsAreWaiting();
113 void SpinUntilTaskCountLessThan(int task_count); 112 void SpinUntilTaskCountLessThan(int task_count);
114 113
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 return count; 643 return count;
645 } 644 }
646 645
647 int WorkQueue::GetNumberOfCompletedTasks() const { 646 int WorkQueue::GetNumberOfCompletedTasks() const {
648 int total = 0; 647 int total = 0;
649 for (int i = 0; i < thread_count_; ++i) 648 for (int i = 0; i < thread_count_; ++i)
650 total += completion_history_[i]; 649 total += completion_history_[i];
651 return total; 650 return total;
652 } 651 }
653 652
654 TimeDelta WorkQueue::GetWorkTime() const {
655 return worker_delay_;
656 }
657
658 void WorkQueue::SetWorkTime(TimeDelta delay) { 653 void WorkQueue::SetWorkTime(TimeDelta delay) {
659 worker_delay_ = delay; 654 worker_delay_ = delay;
660 } 655 }
661 656
662 void WorkQueue::SetTaskCount(int count) { 657 void WorkQueue::SetTaskCount(int count) {
663 task_count_ = count; 658 task_count_ = count;
664 } 659 }
665 660
666 void WorkQueue::SetAllowHelp(bool allow) { 661 void WorkQueue::SetAllowHelp(bool allow) {
667 allow_help_requests_ = allow; 662 allow_help_requests_ = allow;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 base::AutoLock auto_lock(lock_); 754 base::AutoLock auto_lock(lock_);
760 // Send notification that we completed our "work." 755 // Send notification that we completed our "work."
761 WorkIsCompleted(thread_id); 756 WorkIsCompleted(thread_id);
762 } 757 }
763 } 758 }
764 } 759 }
765 760
766 } // namespace 761 } // namespace
767 762
768 } // namespace base 763 } // namespace base
OLDNEW
« no previous file with comments | « base/prefs/pref_notifier_impl_unittest.cc ('k') | device/bluetooth/bluetooth_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698