task
Index
BOOL AddTaskHook(
struct Hook * tHook,
ULONG thType );
LONG AllocTaskStorageSlot();
This function will allocate a slot in the task storage.
The allocated SlotID, or 0 if no slotid could be allocated.
After this function SetTaskStorageSlot(slotid) may be used to store
values with each slotid.
void FreeTaskStorageSlot();
This function will free a slot in task storage
slotid - The slot id to free.
Currently no checks are performed to determine if one is the owner
of the slotid. This may be added in the future, so one should
deallocate a slotid from the same task that allocated the slotid.
IPTR GetParentTaskStorageSlot();
Get a value for a task storage slot of parent task.
slotid - slot ID returned from AllocTaskStorageSlot().
Value stored by SetTaskStorageSlot() on parent task, or
(IPTR)NULL if the slot was never used.
Since you are accessing value of another task, the value
might be invalid/freed by the time this function returns.
To be sure value is still valid, call this function under
Forbid().
IPTR GetTaskStorageSlot();
Get a value for a task storage slot.
slotid - slot ID returned from AllocTaskStorageSlot().
Value stored by SetTaskStorageSlot(), or (IPTR)NULL if the slot was
never used.
BOOL InitTaskHooks(
APTR thDispatcher,
ULONG thType,
ULONG thFlags );
thDispatcher - default dispatcher used to call the hook.
thType - Task Hook Type for the list.
thFlags -
THF_ROA - Runs a TaskHook immidiately when it is added.
THF_IAR - Runs a TaskHook immidiately if the TaskHooks have been run.
struct TaskList * LockTaskList(
ULONG flags );
flags -
LTF_WRITE Lock The TaskList for writing
NB: In general software SHOULDNT
need to use this!
LTF_RUNNING Lock The TaskList to show running tasks.
LTF_READY Lock The TaskList to show ready tasks.
LTF_WAITING Lock The TaskList to show waiting/spinning tasks.
LTF_ALL Lock The TaskList to show all of the above tasks.
Handle to the task list. This is not a direct pointer
to the first list element but to a pseudo element instead.
struct Task * NextTaskEntry(
struct TaskList * tlist,
ULONG flags );
Looks for the next task list entry with the right type. The list
must be locked for this.
tlist - the value given by LockTaskList()
flags - the same flags as given to LockTaskList() or a subset
of them.
Pointer to task entry found or NULL if the are no more entries.
void QueryTaskTagList(
struct Task * task,
struct TagItem * tagList );
void QueryTaskTags(
struct Task * task,
TAG tag, ... );
Provides information about selected system Task
Function takes an array of tags. Data is returned for each tag. See
specific tag description.
TaskTag_CPUNumber - (IPTR *) Returns the CPU Number the task is currently running on
TaskTag_CPUAffinity - (IPTR *) Returns the CPU Affinity mask
TaskTag_CPUTime - (struct timeval *) Returns the amount of cpu time a task has used .
TaskTag_StartTime - (struct timeval *) Returns the time the task was launched .
void RestoreTaskStorage();
This function restores the current state of the task storage slotalloccnt.
handle - ID returned from SaveTaskStorage() referring to the state.
BOOL RunTaskHooks(
APTR thDispatcher,
ULONG thType );
This function remembers the current state of the task storage slots.
An ID will be returned with which the current state can be restored
using RestoreTaskStorage(). NULL is returned when not enough memory
is available.
id - ID for use with RestoreTaskStorage(), or NULL.
BOOL SetTaskStorageSlot();
Puts a new value in a task storage slot. If necessary, the number of
task storage slotalloccnt will be increased.
slotid - slot ID returned from AllocTaskStorageSlot().
value - value to store in the slot.
success - TRUE if the value was successfully stored.
void UnLockTaskList(
struct TaskList * tlist,
ULONG flags );
Frees a lock on the task lists given by LockTaskList().
flags - the same value as given to LockTaskList().
|
|