name: duk_push_thread_new_globalenv proto: | duk_idx_t duk_push_thread_new_globalenv(duk_context *ctx); stack: | [ ... ] -> [ ... thr! ] summary: |
Push a new Duktape thread (context, coroutine) to the stack. Returns
non-negative index (relative to stack bottom) of the pushed thread.
The new thread will be associated with the same Duktape heap as the
argument ctx
, but will have a new global object environment
(separate from the one used by ctx
).
To interact with the new thread with the Duktape API, use
duk_get_context()
to get
a context pointer for API calls.