[−][src]Function dqcsim::bindings::dqcs_plugin_start
#[no_mangle]pub extern "C" fn dqcs_plugin_start(
pdef: dqcs_handle_t,
simulator: *const c_char
) -> dqcs_handle_t
Executes a plugin in a worker thread.
This function behaves the same as dqcs_plugin_log(), but is asynchronous;
it always returns immediately. Of course, this means that the callbacks in
pdef
will be called from a different thread.
To wait for the thread to finish executing, call dqcs_plugin_wait()
on
the returned join handle. Alternatively you can delete the join handle
object, which will detach the thread.
Note that dqcs_log_*()
will only be available in the thread that the
plugin actually runs in.
This function returns 0 to indicate failure to start the plugin. Otherwise, the join handle is returned.