Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 23 - Programming With Open Transport Reference / Functions
Working With System Tasks /


OTScheduleSystemTask

Schedules a task for execution at system task time.

C INTERFACE
Boolean OTScheduleSystemTask(long stCookie)
C++ INTERFACE
None. C++ applications use the C interface to this function.

PARAMETERS
stCookie
A reference that identifies the task to be scheduled.
function result
A result of true means that the system task is scheduled to run. If the function returns false and the stCookie parameter has a valid value (i.e. other than 0), then the task is already scheduled to run. If stCookie is invalid (a value of 0), the function returns false and does nothing.
DISCUSSION
The OTScheduleSystemTask function schedules for execution at system task time the task associated with the stCookie parameter, which is a reference to a system task created by the OTCreateSystemTask function.

You can call this function at any time. If you have not yet destroyed a task, you can use this function to reschedule the same task again once it has executed. If you have canceled a task, you can use this function to schedule it again.

If you make multiple calls to the OTScheduleSystemTask function before the task is executed, additional tasks are not scheduled; only one instance of each unique task is scheduled at a time.

WARNING
Open Transport does not keep track of outstanding system task requests. It is the caller's responsibility to ensure that all outstanding system task requests have either executed or have been cancelled. If this is not done, and the calling process terminates before the system task executes, the processor will crash when it attempts to execute the task.
SPECIAL CONSIDERATIONS
You can call this Open Transport function at hardware interrupt time, but you must precede it by calling the OTEnterInterrupt function and you must follow it by calling the OTLeaveInterrupt function.

SEE ALSO
The OTCreateSystemTask function.

The OTDestroySystemTask function.

The OTCancelSystemTask function.

The OTEnterInterrupt function.

The OTLeaveInterrupt function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998