awThreadedCallbacks
BrokerError awThreadedCallbacks(BrokerBoolean enabled);
enabled | If set to 1 (true) , callback functions will be enabled; 0 (false) means callbacks are to be disabled. |
Enables or disables the use of callbacks on a system thread. Use this function in a multi-threaded environment to request callbacks on an event's thread instead of the main thread. Enabling threaded callbacks in a multi-threaded environment allows you to replace the use of event loops and blocking operations.
When using awThreadedCallbacks, you cannot invoke any of the following functions:
Possible BrokerError major codes | Meaning |
AW_ERROR_BAD_STATE | Another thread has already invoked
awDispatch or
awMainLoop, or an attempt was made to set the threaded callback state to its current state. |
AW_ERROR_NOT_IMPLEMENTED | This application was not linked with the multi-threaded version of the Broker library. |
See also: