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

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

Issue 1447353002: Start isolates in a separate thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: reupload Created 5 years, 1 month 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 | « runtime/vm/isolate.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 "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_barrier.h" 10 #include "vm/thread_barrier.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 Dart_Handle async_lib = Dart_LookupLibrary(url); 70 Dart_Handle async_lib = Dart_LookupLibrary(url);
71 DART_CHECK_VALID(async_lib); 71 DART_CHECK_VALID(async_lib);
72 DART_CHECK_VALID(Dart_Invoke( 72 DART_CHECK_VALID(Dart_Invoke(
73 async_lib, NewString("_setScheduleImmediateClosure"), 1, args)); 73 async_lib, NewString("_setScheduleImmediateClosure"), 1, args));
74 74
75 75
76 result = Dart_Invoke(test_lib, NewString("testMain"), 0, NULL); 76 result = Dart_Invoke(test_lib, NewString("testMain"), 0, NULL);
77 EXPECT(!Dart_IsError(result)); 77 EXPECT(!Dart_IsError(result));
78 // Run until all ports to isolate are closed. 78 // Run until all ports to isolate are closed.
79 result = Dart_RunLoop(); 79 result = Dart_RunLoop();
80 EXPECT_ERROR(result, "Null callback specified for isolate creation"); 80 EXPECT_ERROR(result,
81 "Isolate spawn is not supported by this Dart implementation");
81 EXPECT(Dart_ErrorHasException(result)); 82 EXPECT(Dart_ErrorHasException(result));
82 Dart_Handle exception_result = Dart_ErrorGetException(result); 83 Dart_Handle exception_result = Dart_ErrorGetException(result);
83 EXPECT_VALID(exception_result); 84 EXPECT_VALID(exception_result);
84 } 85 }
85 86
86 87
87 class InterruptChecker : public ThreadPool::Task { 88 class InterruptChecker : public ThreadPool::Task {
88 public: 89 public:
89 static const intptr_t kTaskCount; 90 static const intptr_t kTaskCount;
90 static const intptr_t kIterations; 91 static const intptr_t kIterations;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // Wait for all tasks to observe the interrupt. 144 // Wait for all tasks to observe the interrupt.
144 barrier.Sync(); 145 barrier.Sync();
145 // Continue with next round. 146 // Continue with next round.
146 uword interrupts = isolate->GetAndClearInterrupts(); 147 uword interrupts = isolate->GetAndClearInterrupts();
147 EXPECT((interrupts & Isolate::kVMInterrupt) != 0); 148 EXPECT((interrupts & Isolate::kVMInterrupt) != 0);
148 } 149 }
149 barrier.Exit(); 150 barrier.Exit();
150 } 151 }
151 152
152 } // namespace dart 153 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698