Function jscjs_sys::api::JSContextGroupCreate[][src]

pub unsafe extern "C" fn JSContextGroupCreate() -> JSContextGroupRef
Expand description

@function @abstract Creates a JavaScript context group. @discussion A JSContextGroup associates JavaScript contexts with one another. Contexts in the same group may share and exchange JavaScript objects. Sharing and/or exchanging JavaScript objects between contexts in different groups will produce undefined behavior. When objects from the same context group are used in multiple threads, explicit synchronization is required.

A JSContextGroup may need to run deferred tasks on a run loop, such as garbage collection or resolving WebAssembly compilations. By default, calling JSContextGroupCreate will use the run loop of the thread it was called on. Currently, there is no API to change a JSContextGroup’s run loop once it has been created. @result The created JSContextGroup.