Programmer Reference : VAST Virtual Machine API : Asynchronous callouts : Locking resources for an asynchronous call
Locking resources for an asynchronous call
Occasionally, several calls must be made in the same thread. For example, in Windows to get the last error code from a function call, developers must make the GetLastError call in the same thread as the original call was made.
By using the lockThreadIn: aBlock protocol in the AcoResourceManager the developer specifies a series of standard asynchronous calls (for example, asyncCall) to be made in the same operating system thread. The protocol reserves a single thread for all the calls made in the scope of the block.
The following is an example of standard asynchronous calls (dosBeep and getLastError) that are guaranteed to occur in the same thread:
AcoResourceManager default lockThreadIn: [
rc := isUppercase asyncCallWith: param1
rc2 := getLastError asyncCall]
Last modified date: 08/10/2017