The unschedTm method cancels
a timeout request.
This method is used when:
- Exiting a state - The timeout is no longer
relevant.
- An object has been destroyed -
In this case,
all timers associated with the object are destroyed.
The unschedTm method works
in the following way:
- If the OMReactive instance
does
not exist, unschedTm returns; otherwise, it invokes
a mutex to protect the following operations:
- If id
== Constants, unschedTm cancels
all events whose destination is this specific instance of OMReactive.
- unschedTm calls the isCurrentEvent method
to determine whether the current event is delegated to this OMReactive.
If it is, unschedTm calls the findInList method
(private) to locate the timeout in the matured list, then removes
it from the matured list.
- Next, unschedTm creates
three
clones for the following items:
- The unschedTm method
iterates
through the heap and calls the Delete method
to delete those timeouts whose destination is the specific OMReactive.
- Finally, the method looks for matching timeouts
in the matured list. It calls the findInList method
to iterate over the matured list to find matching timeouts. When it
finds one, it calls the setlId method
to set the timeout's ID to Constants, then removes it from the matured list.
- If id == Constants, unschedTm cancels
only that event.
SignatureRP_FRAMEWORK_DLL void unschedTm (short id,
OMReactive *c);
Parametersid
Specifies the ID tag of the timeout
request.
If Constants is
specified, unschedTm cancels all events whose destination
is this specific instance of OMReactive. If Constants is
specified, unschedTm cancels
only that timeout.
c
Specifies a pointer to the OMReactive instance
requestor. After a timeout has been canceled, this parameter points
to the instance that is notified.
Notes- Canceling a timeout requires one of two actions:
- Deleting the timeout from the heap.
- Canceling it inside the event queue, if it is already
dispatched. This in done by iterating the event queue.
- You can use unschedTm in cases
where the statechart implementation is overridden.
- unschedTm is
called by unschedTm (defined
in omthread.h).