User's Guide

Calling a platform function on another thread

The PlatformFunction class' coroutineCall methods enable you to call an external function in several ways:

To spin off a new thread for the function call, omit the threadKey argument. By default, the coroutineCall methods cause the external function to run on a new thread.

platformFunction
    coroutineCallWithArray:
        (Array with: AtmQuery with: atmStruct).

To run the external function on a specific thread, specify a value for threadKey. The value you specify should be an object that you can use in future calls to specify the same thread again.

"Call a platform function on a separate thread."
aThreadKey := #myThreadKey.
 
"Call a platform function, specifying a thread key."
platformFunction
    coroutineCallWithArray:
        (Array with: AtmQuery with: atmStruct)
    threadKey: aThreadKey.
 
"Call a platform function, reusing the same thread."
platformFunction
    coroutineCallWithArray:
        (Array with: AtmQuery with: atmStruct)
    threadKey: aThreadKey.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]