threadLockEvent()- creates an object of class threadLockEvent to be used as the
names(threadLockEventTable)and are provided in the following table.
| ||any assignment to the object of the given name by another thread|
| ||the object is removed from the database.|
| ||the object exists in the database.|
Alternatively, this can be supplied as a single numeric value
which is the OR'ing of the values in
corresponding the names. This can be used for
efficiency purposes to avoid repeated matching if the
lock is performed regularly, for example in a loop.
The values can be retrieved using
threadLockEventTable[event-name]where event-name is a string from the table above. Rather than supplying the numeric values each time, however, we recommend that the threadLockEvent object is created outside the loop using the relevant strings.
# will wait until the object "x" is assigned a value threadLockEvent("x", "assign") # will wait until the object "messages" exists threadLockEvent("messages","exists")