Unit 'EXEC' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#amunits]

FindTask

Find task by name get own task

Declaration

Source position: exec.pas line 1237

function FindTask(

  const name: pCHAR

):pTask;

function FindTask(

  const name: string

):pTask;

Arguments

name

  

Name of task to found.

Function result

A pointer to the task or process, or nil if none found.

Arguments

name

  

Name of task to found.

Description

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 nil name pointer is given a pointer to the current task will be returned.

Finding oneself with a nil 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.


Documentation generated on: 2021-07-30