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 /


OTCreateSystemTask

Creates a reference to a task that can later be scheduled to run at system task time.

C INTERFACE
long OTCreateSystemTask(OTProcessProcPtr proc, 
                                         void* arg)
C++ INTERFACE
None. C++ applications use the C interface to this function.

PARAMETERS
proc
A pointer to the process callback function you want executed at system task time.
arg
A context pointer for your use. Open Transport simply passes the value as the original to the procedure specified by the proc parameter. Pass NULL if you do not want any data passed. If you are creating more than one of the same kind of task, you can use different values for arg to distinguish between the tasks.
function result
A reference that should be used when scheduling or destroying the task. A value of 0 indicates that there is not enough memory to allocate the necessary data.
DISCUSSION
The OTCreateSystemTask function creates a system task that you can schedule for execution at system task time using the OTScheduleSystemTask function. The task gets a pointer to the callback function specified by the proc parameter, and its argument specified by the arg parameter. (For 68000 code, when Open Transport executes the callback function, it restores the A5 global world to what it was when you originally called the OTCreateSystemTask function.)

It is important that you call the function OTDestroySystemTask when you are done with processing your system tasks. Open Transport does not automatically deallocate the memory and resources used to schedule system tasks when you close Open Transportjuok.

IMPORTANT
Never pass a universal procedure pointer as the proc parameter for this call.
SEE ALSO
The OTScheduleSystemTask function.

The OTDestroySystemTask function.

The OTCancelSystemTask function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998