Lock object (Object/NES)

Provides a way of locking objects against multiple simultaneous access by several clients at once.

Availability:

JavaScript - 1.2
Netscape Enterprise Server - 3.0
JavaScript syntax:NESmyLock = Lock
NESmyLock = new Lock()
Object properties:constructor, prototype
Object methods:isValid(), lock(), unlock()

In a server back end environment, you may have some objects which you share amongst several sessions. This means that they could be accessed on behalf of several clients all at once. You may want to prevent this happening by locking the object as the first client's request accesses it, and then unlocking it again as the request handler for that client no longer needs access to it.

You can create new Lock objects with the Lock() constructor.

It is good manners to unlock resources as soon as you can so that other processes can carry on running. You should not rely on the script exit handler unlocking the locks you place on objects.

Warnings:

See also:Netscape Enterprise Server, unwatch(), watch()

PropertyJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
constructor1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
prototype1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-

MethodJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
isValid()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
lock()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
unlock()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-