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

Unified Diff: runtime/include/dart_api.h

Issue 2720723005: VM: Fix an app-jit related shutdown race. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/run_vm_tests.cc ('k') | runtime/vm/dart.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 4db93630fc3f533ed4bbf7c2e78767134dd3d34a..e18df1bf24080c02a1850811e8d5cdd9149f8483 100644
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -708,6 +708,22 @@ typedef void (*Dart_IsolateUnhandledExceptionCallback)(Dart_Handle error);
typedef void (*Dart_IsolateShutdownCallback)(void* callback_data);
/**
+ * An isolate cleanup callback function.
+ *
+ * This callback, provided by the embedder, is called after the vm
+ * shuts down an isolate. There will be no current isolate and it is *not*
+ * safe to run Dart code.
+ *
+ * This function should be used to dispose of native resources that
+ * are allocated to an isolate in order to avoid leaks.
+ *
+ * \param callback_data The same callback data which was passed to the
+ * isolate when it was created.
+ *
+ */
+typedef void (*Dart_IsolateCleanupCallback)(void* callback_data);
+
+/**
* A thread death callback function.
* This callback, provided by the embedder, is called before a thread in the
* vm thread pool exits.
@@ -788,6 +804,8 @@ typedef Dart_Handle (*Dart_GetVMServiceAssetsArchive)();
* See Dart_IsolateCreateCallback.
* \param shutdown A function to be called when an isolate is shutdown.
* See Dart_IsolateShutdownCallback.
+ * \param cleanup A function to be called after an isolate is shutdown.
+ * See Dart_IsolateCleanupCallback.
* \param get_service_assets A function to be called by the service isolate when
* it requires the vmservice assets archive.
* See Dart_GetVMServiceAssetsArchive.
@@ -798,6 +816,7 @@ typedef struct {
const uint8_t* vm_snapshot_instructions;
Dart_IsolateCreateCallback create;
Dart_IsolateShutdownCallback shutdown;
+ Dart_IsolateCleanupCallback cleanup;
Dart_ThreadExitCallback thread_exit;
Dart_FileOpenCallback file_open;
Dart_FileReadCallback file_read;
« no previous file with comments | « runtime/bin/run_vm_tests.cc ('k') | runtime/vm/dart.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698