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

Unified Diff: runtime/include/dart_api.h

Issue 13452007: Add new Dart API call Dart_MakeIsolateRunnable(). This would allow an (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/main.cc ('k') | runtime/lib/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
===================================================================
--- runtime/include/dart_api.h (revision 20976)
+++ runtime/include/dart_api.h (working copy)
@@ -546,6 +546,20 @@
DART_EXPORT const char* Dart_VersionString();
/**
+ * An isolate is the unit of concurrency in Dart. Each isolate has
+ * its own memory and thread of control. No state is shared between
+ * isolates. Instead, isolates communicate by message passing.
+ *
+ * Each thread keeps track of its current isolate, which is the
+ * isolate which is ready to execute on the current thread. The
+ * current isolate may be NULL, in which case no isolate is ready to
+ * execute. Most of the Dart apis require there to be a current
+ * isolate in order to function without error. The current isolate is
+ * set by any call to Dart_CreateIsolate or Dart_EnterIsolate.
+ */
+typedef struct _Dart_Isolate* Dart_Isolate;
+
+/**
* An isolate creation and initialization callback function.
*
* This callback, provided by the embedder, is called when the vm
@@ -573,6 +587,8 @@
* eventually run. This is provided for advisory purposes only to
* improve debugging messages. The main function is not invoked by
* this function.
+ * \param unhandled_exc The name of the function to this isolate will
+ * call when an unhandled exception is encountered.
* \param callback_data The callback data which was passed to the
* parent isolate when it was created by calling Dart_CreateIsolate().
* \param error A structure into which the embedder can place a
@@ -581,10 +597,10 @@
* \return The embedder returns false if the creation and
Anton Muhin 2013/04/08 15:20:17 nit: this doc is not correct any more.
Ivan Posva 2013/04/09 17:38:55 Done.
* initialization was not successful and true if successful.
*/
-typedef bool (*Dart_IsolateCreateCallback)(const char* script_uri,
- const char* main,
- void* callback_data,
- char** error);
+typedef Dart_Isolate (*Dart_IsolateCreateCallback)(const char* script_uri,
+ const char* main,
+ void* callback_data,
+ char** error);
/**
* An isolate interrupt callback function.
@@ -680,20 +696,6 @@
// --- Isolates ---
/**
- * An isolate is the unit of concurrency in Dart. Each isolate has
- * its own memory and thread of control. No state is shared between
- * isolates. Instead, isolates communicate by message passing.
- *
- * Each thread keeps track of its current isolate, which is the
- * isolate which is ready to execute on the current thread. The
- * current isolate may be NULL, in which case no isolate is ready to
- * execute. Most of the Dart apis require there to be a current
- * isolate in order to function without error. The current isolate is
- * set by any call to Dart_CreateIsolate or Dart_EnterIsolate.
- */
-typedef struct _Dart_Isolate* Dart_Isolate;
-
-/**
* Creates a new isolate. The new isolate becomes the current isolate.
*
* A snapshot can be used to restore the VM quickly to a saved state
@@ -827,6 +829,20 @@
*/
DART_EXPORT void Dart_InterruptIsolate(Dart_Isolate isolate);
+
+/**
+ * Make isolate runnable.
+ *
+ * When isolates are spawned this function is used to indicate that
+ * the creation and initialization (including script loading) of the
+ * isolate is complete and the isolate can start.
+ * This function does not expect there to be a current isolate.
+ *
+ * \param isolate The isolate to be made runnable.
+ */
+DART_EXPORT bool Dart_IsolateMakeRunnable(Dart_Isolate isolate);
Anton Muhin 2013/04/08 15:20:17 any restriction on thread affinity?
Ivan Posva 2013/04/09 17:38:55 Not sure I understand the question, but this will
Anton Muhin 2013/04/09 17:45:12 Sorry for not being clear, I was curious if there
Ivan Posva 2013/04/09 18:19:48 The Dart_IsolateMakeRunnable should be callable on
+
+
// --- Messages and Ports ---
/**
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/lib/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698