home *** CD-ROM | disk | FTP | other *** search
- /*
- Task Manager -- Background processing support
- version 2.2.1
-
- This software source package is Copyright ⌐ 1990-91 by Michael Hecht. All Rights
- Reserved. It may be freely distributed in source or object code format; however,
- the source code may not be sold for profit or charged for in any way. The source
- code must be distributed as a package including all H files, sample code and
- projects, and documentation.
-
- I welcome any comments or suggestions that will help me improve or extend the
- functionality of the Task Manager. You can reach me at:
-
- Internet: Michael_Hecht@mac.sas.com
- AppleLink: SAS.HECHT
-
- Happy Tasking!
-
-
- --Michael Hecht
- */
-
- /* Don't re-include */
- #pragma once
-
- /* For compatibility with previous release */
- #define TaskIdle TaskYield
-
- /* Define the following macro as 1 to include stack checking code */
- /* Define the following macro as 0 to remove stack checking code */
- #define TASK_DEBUG 1
-
- /* Default options */
- #define kDefaultWakeTime 60 /* One second */
-
- /* Task procedure */
- typedef void ( *TaskProcPtr )( long taskRefCon );
-
- /* Routines */
- OSErr InitTasking( void );
- OSErr TermTasking( void );
-
- /* Creating tasks */
- OSErr NewTask( TaskProcPtr taskProc, TaskProcPtr taskTermProc,
- long taskRefCon, short *taskRefNum );
- OSErr DisposeTask( short taskRefNum );
-
- /* Running tasks */
- OSErr RunTasks( unsigned long wakeTime );
- OSErr TaskYield( void );
-
- /* Getting task info */
- short CurrentTask( void );
- short CountTasks( void );
- short GetIndTask( short index );
-
- /* Task reference constant */
- long GetTaskRefCon( short taskRefNum );
- OSErr SetTaskRefCon( short taskRefNum, long taskRefCon );
-