LUA verbs can complete execution either synchronously or asynchronously.
When LUA is able to complete all the processing for a verb as soon as it is issued, the verb has completed synchronously. When this happens, the primary return code is set to a value other than lua_in_progress, and the lua_flag2.async bit is set to zero. Note that the value of the lua_flag2.async bit should be tested, not the primary return code being not equal to lua_in_progress. (See individual verb descriptions for information on these returned parameters.)
Some LUA verbs (for example, RUI_PURGE) complete quickly after local processing; however, most verbs take some time to complete because they require messages to be sent to and received from the local node or the host application.
When LUA must wait for information from the remote LU or from the local node before it can complete a verb, the verb completes asynchronously.
When this happens, the lua_flag2.async bit is set to 1. The primary return code is also normally set to lua_in_progress, but this value cannot be relied on. The value of the lua_flag2.async bit should be tested. The application can now perform other processing, or wait for notification from LUA that the verb has completed. LUA issues this notification by setting the primary return code to its final value and leaving lua_flag2.async set to 1.
When the verb completes, LUA does the following depending on your environment:
Issues WaitForSingleObject or WaitForMultipleObject.
—or—
Posts the "WinRUI"/"WinSLI" notification message to the window handle of the WinRUI/WinSLI message.
The event method using WaitForSingleObject or WaitForMultipleObject is the preferred way to receive asynchronous notification on Windows NT or Windows 95.
Note that if the verb completes synchronously, LUA does not clear the semaphore.