Important: The information in this document is obsolete and should not be used for new development.
OTUseSyncIdleEvents
Allows synchronous idle events to be sent to your notifier. (This function can only be called for Open Transport version 1.1.1 or later.)C INTERFACE
OSStatus OTUseSyncIdleEvents ( ProviderRef ref, Boolean onOff);C++ INTERFACE
OSStatus TProvider::UseSyncIdleEvents(Boolean onOff);PARAMETERS
ref
- A provider reference for the provider whose notifier function is to receive synch idle events.
onOff
- A Boolean value indicating whether synchronous idle events can be sent to your notifier.
- function result
- An error code. See Appendix B for more information.
DISCUSSION
This function facilitates the interaction between a notifier and the Thread Manager. Its primary purpose is to allow scheduling of other threads while Open Transport is waiting for a synchronous call to complete. This is the only time that scheduling of a thread from within a notification function is legal.After you call this function with a value of
true
, Open Transport will generatekOTSyncIdleEvent
events and send them to your notifier whenever your execution thread is blocked waiting for an operation to complete. At this point, it is safe to use theYieldtoThread
function. If performance is not an issue, this is a handy method for handling threads. But because theYieldtoThread
function will eventually cause the Thread Manager to switch to a thread that callsWaitNextEvent
, this can impact your performance.SEE ALSO
The chapter "Programming With Open Transport".