Unit 'exec' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#os4units]

SetTaskPri

Get and set the priority of a task

Declaration

Source position: exec.pas line 1794

function SetTaskPri(

  Task: PTask;

  Priority: LongInt

):LongInt;

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