Unit 'Classes' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

TThread.Queue

Queue a method for execution in the main thread.

Declaration

Source position: classesh.inc line 1964

protected procedure TThread.Queue(

  aMethod: TThreadMethod

);

class procedure TThread.Queue(

  aThread: TThread;

  aMethod: TThreadMethod

);

Description

Queue schedules a method aMethod for execution in the main thread. In difference with TThread.Synchronize, Queue just posts the method for execution in a queue, and does not wait for it to be executed, so this call returns at once.

If the call is made in the main thread, the method is not put on the queue, but is executed at once.

In the class procedure overloaded version of this call, the thread for which the method must be posted is the first argument. In the protected version of this call (used in the tthread instance), this argument is not there, and the thread instance is used.

When a thread object is destroyed (after it has finished executing) all its queued calls are removed from the queue list.

See also

TThread.Synchronize

  

Synchronizes the thread by executing the method in the main thread.

TThread.RemoveQueuedEvents

  

Remove methods scheduled for execution from queue.

TTHread.ForceQueue

  

Always queue a method for execution in the main thread.


Documentation generated on: Jul 24 2023