JS_SetContextThread |
Function |
|
Summary
Associate a context with the current thread. No other thread should use
the context while the association lasts.
|
Syntax
intN JS_SetContextThread(JSContext *cx);
Name | Type | Description |
*cx | JSContext | Pointer to a previously established JS context.
|
|
Description
JS_SetContextThread ties cx to the current thread for
exclusive use. No other thread should attempt to use cx until this
association is removed. Use JS_ClearContextThread to break the
tie.
JS_SetContextThread returns the thread ID of the last thread to
be associated with this context.
|
Notes
JS_NewContext performs a JS_SetContextThread implicitly.
JS_SetContextThread is available only if the engine is built
with JS_THREADSAFE .
|
See Also
|