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

Side by Side Diff: runtime/vm/thread_pool_test.cc

Issue 9706033: Fix failing test on windows. I was accessing a stat too early. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « no previous file | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/os.h" 5 #include "vm/os.h"
6 #include "vm/thread.h" 6 #include "vm/thread.h"
7 #include "vm/thread_pool.h" 7 #include "vm/thread_pool.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 MonitorLocker ml(&sync); 56 MonitorLocker ml(&sync);
57 while (!done) { 57 while (!done) {
58 ml.Wait(); 58 ml.Wait();
59 } 59 }
60 } 60 }
61 EXPECT(done); 61 EXPECT(done);
62 62
63 // Do a sanity test on the worker stats. 63 // Do a sanity test on the worker stats.
64 EXPECT_EQ(1U, thread_pool.workers_started()); 64 EXPECT_EQ(1U, thread_pool.workers_started());
65 EXPECT_EQ(0U, thread_pool.workers_stopped()); 65 EXPECT_EQ(0U, thread_pool.workers_stopped());
66 EXPECT_EQ(1U, thread_pool.workers_idle());
67 EXPECT_EQ(0U, thread_pool.workers_running());
68 } 66 }
69 67
70 68
71 UNIT_TEST_CASE(ThreadPool_RunMany) { 69 UNIT_TEST_CASE(ThreadPool_RunMany) {
72 const int kTaskCount = 100; 70 const int kTaskCount = 100;
73 ThreadPool thread_pool; 71 ThreadPool thread_pool;
74 Monitor sync[kTaskCount]; 72 Monitor sync[kTaskCount];
75 bool done[kTaskCount]; 73 bool done[kTaskCount];
76 74
77 for (int i = 0; i < kTaskCount; i++) { 75 for (int i = 0; i < kTaskCount; i++) {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 MonitorLocker ml(&sync); 209 MonitorLocker ml(&sync);
212 while (done < kTotalTasks) { 210 while (done < kTotalTasks) {
213 ml.Wait(); 211 ml.Wait();
214 } 212 }
215 } 213 }
216 EXPECT_EQ(kTotalTasks, done); 214 EXPECT_EQ(kTotalTasks, done);
217 } 215 }
218 216
219 217
220 } // namespace dart 218 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698