Sign in Join
FPDoc Onlineexperiment

CheckSynchronize function

In unit Classes

Check whether there are any synchronize calls in the synchronize queue.

Declaration

pascal
function CheckSynchronize(timeout: LongInt=0): Boolean

Description

CheckSynchronize should be called regularly by the main application thread to handle any Synchronize calls that may be waiting for execution by the main thread. If any such calls are waiting for execution by the main thread, they are executed at once, in the order that they were scheduled.

The function returns True if any Synchronize method was executed.

TimeOut is the maximum amount of time (in milliseconds) that the CheckSynchronize routine will wait for synchronisation requests to appear in the queue.

Calling this routine more often will ensure that synchronize requests are handled faster.

This routine may not be called from any thread other than the main thread, as it will execute the waiting requests.

Threads may call the WakeMainThread to signal the main thread that the synchronisation queue contains items, and thus speed up the execution of the synchronize calls.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.