JavaScript-1.5 Reference

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);
NameTypeDescription
*cxJSContextPointer 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

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_ClearContextThread | JS_GetContextThread | JS_NewContext ]

This page was generated by APIDOC