AAO DRAMA C++ Interface (Old style)
DRAMA C++, Depreciated, don't use for new code
|
◆ Wait()
Wait for the completion of the action supplied with the transaction id. This method waits for the action with the given transaction id to complete. The main reason for this implementation is that sometimes, application code wants to issue an OBEY command and then instead of rescheduling the action, it wants to wait for this command/action to run to completion. One may be tempted to structure the code like this : DcppTask.Obey(ACTION_X,&transId....) DitsActionWait(....) DcppDispatch(....) However, the above code segment may not work correctly when the number of messages which will be outstanding at any one time is greater than one i.e (thread count > 1). This is because the above code segment does not decrement the thread count when the action is finished. The correct way of acheiving the above result is : DcppTask.Obey(ACTION_X,&transId....) DcppHandler.Wait(transId); What the Wait() method does is as described below : (i) invokes DitsActionWait() on the supplied transaction id. (ii) invokes HandleReschedule() which in turns calls DcppDispatch(). It also correctly manages the thread count by decrementing the thread count by one everytime the DcppHandlerRoutine returns DcppFinished. (iii) If for any reason the DcppHandler object does not want to wait for more events, but your target event has not been seen, then the status will be set to DCPP__WAITFAIL. (other then timeout events, see timeout argument)
|
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tony.farrell@mq.edu.au
Generated on Thu Dec 12 2024 23:07:38 for AAO DRAMA C++ Interface (Old style) by 1.9.8