Title:

threadLockEvent() - creates an object of class threadLockEvent to be used as the condition argument for getLock().

Usage:

threadLockEvent(object, event )

Arguments:

name:
the name of the object being monitored. If this is omitted, any event type specified in the event argument causes notification of the lock waiting on this event.
event:
a vector of character strings identifying the events of interest. The possible names are given by the expression
                      names(threadLockEventTable)
	            
and are provided in the following table.
NameEvent
"assign"any assignment to the object of the given name by another thread
"remove"the object is removed from the database.
"exists"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 threadLockEventTable 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.

Return Value:

an object of class threadLockEvent.

See Also:

threadLock
threadLock()
getLock()

Examples:

      # will wait until the object "x" is assigned a value
     threadLockEvent("x", "assign")
      # will wait until the object "messages" exists
     threadLockEvent("messages","exists")

Key Words:

Synchronization
S User Level Threads

Last modified: Tue Mar 4 11:25:37 PST 1997