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

SetTaskPri

Get and set the priority of a task

Declaration

Source position: exec.pas line 1284

function SetTaskPri(

  task: pTask;

  priority: LongInt

):ShortInt;

Arguments

task

  

Task to be affected

priority

  

The new priority for the task (-127 to 5).

Function result

The tasks previous priority

Description

This function changes the priority of a task regardless of its state. The old priority of the task is returned. A reschedule is performed, and a context switch may result.

To change the priority of the currently running task, pass the result of FindTask(nil); as the task pointer.


Documentation generated on: 2021-07-30