JavaScript-1.5 Reference

JS_EndRequest Function

Summary

Indicates to the JS engine that an application thread is leaving a critical section that calls the JS API freely but does not block.

Syntax

void JS_EndRequest(JSContext *cx);

Description

When your multi-threaded application has called JS_BeginRequest and no longer needs to call the JS API in a non-blocking burst of activity, JS_EndRequest safely decrements the request counter for the JS engine runtime associated with a given context, cx. If decrementing the counter reduces it to zero, JS_EndRequest locks the runtime and notifies the garbage collector so that values no longer in use can be cleaned up.

The application may nest calls to JS_BeginRequest provided it balances each such call with a matching JS_EndRequest.

Notes

JS_EndRequest is available only if you compile the JS engine with JS_THREADSAFE defined. In a default engine compilation, JS_THREADSAFE is undefined.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_BeginRequest | JS_ResumeRequest | JS_SuspendRequest ]

This page was generated by APIDOC