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

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

Issue 1295433003: Reduce size of test StackLimitInterrupts to avoid Win timeouts. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/globals.h" 7 #include "vm/globals.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/lockers.h" 9 #include "vm/lockers.h"
10 #include "vm/thread_pool.h" 10 #include "vm/thread_pool.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 private: 143 private:
144 Isolate* isolate_; 144 Isolate* isolate_;
145 Monitor* awake_monitor_; 145 Monitor* awake_monitor_;
146 bool* awake_; 146 bool* awake_;
147 Monitor* round_monitor_; 147 Monitor* round_monitor_;
148 const intptr_t* round_; 148 const intptr_t* round_;
149 }; 149 };
150 150
151 151
152 const intptr_t InterruptChecker::kTaskCount = 50; 152 const intptr_t InterruptChecker::kTaskCount = 5;
153 const intptr_t InterruptChecker::kIterations = 1000; 153 const intptr_t InterruptChecker::kIterations = 10;
154 154
155 155
156 // Waits for all tasks to set their individual flag, then clears them all. 156 // Waits for all tasks to set their individual flag, then clears them all.
157 static void WaitForAllTasks(bool* flags, Monitor* monitor) { 157 static void WaitForAllTasks(bool* flags, Monitor* monitor) {
158 MonitorLocker ml(monitor); 158 MonitorLocker ml(monitor);
159 while (true) { 159 while (true) {
160 intptr_t count = 0; 160 intptr_t count = 0;
161 for (intptr_t task = 0; task < InterruptChecker::kTaskCount; ++task) { 161 for (intptr_t task = 0; task < InterruptChecker::kTaskCount; ++task) {
162 if (flags[task]) { 162 if (flags[task]) {
163 ++count; 163 ++count;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 MonitorLocker ml(&round_monitor); 206 MonitorLocker ml(&round_monitor);
207 ++round; 207 ++round;
208 ml.NotifyAll(); 208 ml.NotifyAll();
209 } 209 }
210 } 210 }
211 // Wait for tasks to exit cleanly. 211 // Wait for tasks to exit cleanly.
212 WaitForAllTasks(awake, &awake_monitor); 212 WaitForAllTasks(awake, &awake_monitor);
213 } 213 }
214 214
215 } // namespace dart 215 } // 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