Failure to construct a new Lock object indicates an internal JavaScript error, such as out of memory. Property Summary Property Description constructor Specifies the function that creates an object's prototype. Allows the addition of properties to the object. Method Summary Method Description isValid Verifies that this Lock object was properly constructed. In addition, this object inherits the watch and unwatch methods from Object .
Parameters timeout An integer indicating the number of seconds to wait for the lock.
The default value is 0, so if you do not specify a value, the method waits indefinitely. Returns True if it succeeds in obtaining the lock within the specified timeout. False if it did not obtain the lock. Description You can obtain a lock for an object to ensure that different clients do not access a critical section of code simultaneously. When an application locks an object, other client requests must wait before they can lock the object.