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

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

Issue 789243003: Interrupt isolates immediately (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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/include/dart_api.h ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 1445
1446 1446
1447 DART_EXPORT void Dart_InterruptIsolate(Dart_Isolate isolate) { 1447 DART_EXPORT void Dart_InterruptIsolate(Dart_Isolate isolate) {
1448 TRACE_API_CALL(CURRENT_FUNC); 1448 TRACE_API_CALL(CURRENT_FUNC);
1449 if (isolate == NULL) { 1449 if (isolate == NULL) {
1450 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); 1450 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
1451 } 1451 }
1452 // TODO(16615): Validate isolate parameter. 1452 // TODO(16615): Validate isolate parameter.
1453 Isolate* iso = reinterpret_cast<Isolate*>(isolate); 1453 Isolate* iso = reinterpret_cast<Isolate*>(isolate);
1454 iso->ScheduleInterrupts(Isolate::kApiInterrupt); 1454 iso->ScheduleInterrupts(Isolate::kApiInterrupt);
1455 // Can't use Dart_Post() since there isn't a current isolate.
1456 const Dart_CObject api_null = { Dart_CObject_kNull , { 0 } };
1457 Dart_PostCObject(iso->main_port(), &api_null);
1455 } 1458 }
1456 1459
1457 1460
1458 DART_EXPORT bool Dart_IsolateMakeRunnable(Dart_Isolate isolate) { 1461 DART_EXPORT bool Dart_IsolateMakeRunnable(Dart_Isolate isolate) {
1459 CHECK_NO_ISOLATE(Isolate::Current()); 1462 CHECK_NO_ISOLATE(Isolate::Current());
1460 if (isolate == NULL) { 1463 if (isolate == NULL) {
1461 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); 1464 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
1462 } 1465 }
1463 // TODO(16615): Validate isolate parameter. 1466 // TODO(16615): Validate isolate parameter.
1464 Isolate* iso = reinterpret_cast<Isolate*>(isolate); 1467 Isolate* iso = reinterpret_cast<Isolate*>(isolate);
(...skipping 3956 matching lines...) Expand 10 before | Expand all | Expand 10 after
5421 5424
5422 5425
5423 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( 5426 DART_EXPORT void Dart_RegisterRootServiceRequestCallback(
5424 const char* name, 5427 const char* name,
5425 Dart_ServiceRequestCallback callback, 5428 Dart_ServiceRequestCallback callback,
5426 void* user_data) { 5429 void* user_data) {
5427 Service::RegisterRootEmbedderCallback(name, callback, user_data); 5430 Service::RegisterRootEmbedderCallback(name, callback, user_data);
5428 } 5431 }
5429 5432
5430 } // namespace dart 5433 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698