Home  /  Autodocs  /  exec.library

NAME

FindTask
find a Task with the given name or find oneself

SYNOPSIS

task = FindTask(name)
D0 A1

struct Task *FindTask(STRPTR);

FUNCTION

This function will check all Task queues for a Task with the given name, and return a pointer to its Task control block. If a NULL name pointer is given a pointer to the current Task will be returned.

Finding oneself with a NULL for the name is very quick. Finding a Task by name is very system expensive, and will disable interrupts for a long time. Since a Task may remove itself at any time, a Forbid()/Permit() pair may be needed to ensure the pointer returned by FindTask() is still valid when used.

INPUTS

name
pointer to a name string

RESULT

task
pointer to the Task (or Process)

SEE ALSO

Forbid(), Permit()