|
Whitebeam Template Reference Documentation
|
System Template
release()
Call this method to release a semaphore that was allocated using rb.semaphore.lock
Syntax
number = rb.semaphore.release(semaphoreName, ownershipID)
Parameters
The 'release' method takes 2 parameters:
Name | Type/Value | Range/Length | Description | semaphoreName | string | | Required. The name of the sempahore to be released. | ownershipID | string | | Required. The unique ownership string returned from the successful lock request |
Results
The 'release' method returns number:
Type/Value | Range/Length | Description |
number |
  |
0 if the semaphore wasn't owned by the caller or 1 if it was owned and has been released
|
Remarks
This method will attempt to release a semaphore locked with rb.semaphore.lock. The 'ownershipID' oacts like
a key. It must match the ownership ID returned from rb.semaphore.lock to the Presentation Engine instance
that successfully locked the semaphore.
Example
var key = rb.semaphore,lock('my semaphore', 60, 'Locking page access');
if (key!=null) {
// Do critical work here
rb.semaphore.release('my semaphore', key);
}
|
|
(loadtime : 168ms) |