Function js::jsapi::JS_AbortIfWrongThread
[−]
[src]
pub unsafe extern "C" fn JS_AbortIfWrongThread(rt: *mut JSRuntime)
A JS runtime always has an "owner thread". The owner thread is set when the runtime is created (to the current thread) and practically all entry points into the JS engine check that a runtime (or anything contained in the runtime: context, compartment, object, etc) is only touched by its owner thread. Embeddings may check this invariant outside the JS engine by calling JS_AbortIfWrongThread (which will abort if not on the owner thread, even for non-debug builds).