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: Processes
Chapter 6 - Deferred Task Manager / Deferred Task Manager Reference
Deferred Task Manager Routine /


DTInstall

After defining the fields of a deferred task record, you can call the DTInstall function to install the record into the deferred task queue.

FUNCTION DTInstall (dtTaskPtr: QElemPtr): OSErr;
dtTaskPtr
A pointer to a queue element to add to the deferred task queue.
DESCRIPTION
The DTInstall function adds the specified task record to the deferred task queue. Your application should fill in all fields of the task record except qLink and qFlags.

Ordinarily, you call DTInstall only at interrupt time. The DTInstall function does not actually execute the routine specified in the dtAddr field of the task record. Each system interrupt handler executes routines stored in the deferred task queue after reenabling interrupts. After a routine in the queue is executed, it is removed from the deferred task queue.

If the qType field of the task record is not set to ORD(dtQType), DTInstall returns vTypErr and does not add the record to the queue. Otherwise, DTInstall returns noErr.

ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for DTInstall are
Registers on entry
A0Pointer to new queue entry
Registers on exit
D0Result code

To reduce overhead at interrupt time, instead of executing the DTInstall trap, you can load the jump vector jDTInstall into an address register other than A0 and execute a JSR instruction using that register.

RESULT CODES
noErr0No error
vTypErr-2Invalid qType value (must be ORD(dtQType))


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996