[][src]Type Definition dart_sys::Dart_InitializeIsolateCallback

type Dart_InitializeIsolateCallback = Option<unsafe extern "C" fn(child_isolate_data: *mut *mut c_void, error: *mut *mut c_char) -> bool>;

An isolate initialization callback function.

This callback, provided by the embedder, is called when the VM has created an isolate within an existing isolate group (i.e. from the same source as an existing isolate).

The callback should setup native resolvers and might want to set a custom message handler via Dart_SetMessageNotifyCallback and mark the isolate as runnable.

This callback may be called on a different thread than the one running the parent isolate.

When the function returns false, it is the responsibility of this function to ensure that Dart_ShutdownIsolate has been called.

When the function returns false, the function should set *error to a malloc-allocated buffer containing a useful error message. The caller of this function (the VM) will make sure that the buffer is freed.

\param child_isolate_data The callback data to associate with the new child isolate. \param error A structure into which the embedder can place a C string containing an error message in the case the initialization fails.

\return The embedder returns true if the initialization was successful and false otherwise (in which case the VM will terminate the isolate).