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

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

Issue 128653004: Use list of isolates in profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/thread_interrupter_win.cc ('k') | 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/isolate.h" 6 #include "vm/isolate.h"
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 #include "vm/profiler.h" 8 #include "vm/profiler.h"
9 #include "vm/thread.h" 9 #include "vm/thread.h"
10 10
(...skipping 17 matching lines...) Expand all
28 // purpose. 28 // purpose.
29 isolate->Shutdown(); 29 isolate->Shutdown();
30 delete isolate; 30 delete isolate;
31 delete mutex; 31 delete mutex;
32 } 32 }
33 33
34 34
35 UNIT_TEST_CASE(Monitor) { 35 UNIT_TEST_CASE(Monitor) {
36 // This unit test case needs a running isolate. 36 // This unit test case needs a running isolate.
37 Isolate* isolate = Isolate::Init(NULL); 37 Isolate* isolate = Isolate::Init(NULL);
38 // Profiler interrupts interfere with this test. 38 // Thread interrupter interferes with this test, disable interrupts.
39 isolate->set_thread_state(NULL);
39 Profiler::EndExecution(isolate); 40 Profiler::EndExecution(isolate);
40 Monitor* monitor = new Monitor(); 41 Monitor* monitor = new Monitor();
41 monitor->Enter(); 42 monitor->Enter();
42 monitor->Exit(); 43 monitor->Exit();
43 44
44 const int kNumAttempts = 5; 45 const int kNumAttempts = 5;
45 int attempts = 0; 46 int attempts = 0;
46 while (attempts < kNumAttempts) { 47 while (attempts < kNumAttempts) {
47 MonitorLocker ml(monitor); 48 MonitorLocker ml(monitor);
48 int64_t start = OS::GetCurrentTimeMillis(); 49 int64_t start = OS::GetCurrentTimeMillis();
(...skipping 20 matching lines...) Expand all
69 EXPECT_LT(attempts, kNumAttempts); 70 EXPECT_LT(attempts, kNumAttempts);
70 71
71 // The isolate shutdown and the destruction of the mutex are out-of-order on 72 // The isolate shutdown and the destruction of the mutex are out-of-order on
72 // purpose. 73 // purpose.
73 isolate->Shutdown(); 74 isolate->Shutdown();
74 delete isolate; 75 delete isolate;
75 delete monitor; 76 delete monitor;
76 } 77 }
77 78
78 } // namespace dart 79 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/thread_interrupter_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698