Carbon


DebuggerThreadSchedulerProcPtr

Header: Threads.h Carbon status: Supported

Defines a pointer to a thread scheduler debugging callback function. A thread scheduler debugging callback function is a debugging function that the Thread Manager calls whenever a thread is scheduled.

typedef ThreadID(* DebuggerThreadSchedulerProcPtr) (
    SchedulerInfoRecPtr schedulerInfo
);

You would declare your function like this if you were to name it MyDebuggerThreadSchedulerCallback:

ThreadID MyDebuggerThreadSchedulerCallback (
    SchedulerInfoRecPtr schedulerInfo
);
Parameter descriptions
schedulerInfo

A pointer to a scheduler information structure that the SetDebuggerNotificationProcs function passes to the MyDebuggerThreadSchedulerCallback function. Among other information, the scheduler information structure contains the ID of the current thread and the ID of the thread that the Thread Manager has scheduled to run next.

DISCUSSION

The MyDebuggerThreadSchedulerCallback function is one of three debugging functions that you can install with the SetDebuggerNotificationProcs function. The Thread Manager calls MyDebuggerThreadSchedulerCallback whenever an application schedules a new thread to run. The MyDebuggerThreadSchedulerCallback function gets the last look at the thread being scheduled—that is, the Thread Manager calls this function after the Thread Manager default scheduling mechanism and a custom scheduler, if you have installed one, decide on the next thread to schedule.

If you wish, you can use this debugging callback function to schedule a different thread than that chosen by the Thread Manager and any custom scheduling function. The MyDebuggerThreadSchedulerCallback returns the thread ID of the next thread to schedule. The MyDebuggerThreadSchedulerCallback can specify kNoThreadID for the thread ID if you do not want to change the decision of the Thread Manager default scheduler or a custom scheduler.

To schedule a thread, use functions such as YieldToAnyThread, YieldToThread, and SetThreadState.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)