Function mozjs::jsapi::JS_AbortIfWrongThread
source · pub unsafe extern "C" fn JS_AbortIfWrongThread(cx: *mut JSContext)
Expand description
A JS context always has an “owner thread”. The owner thread is set when the context is created (to the current thread) and practically all entry points into the JS engine check that a context (or anything contained in the context: runtime, 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).