From Appmethod Libraries
Jump to: navigation, search

Object Pascal

WakeMainThread: TNotifyEvent = nil;


extern DELPHI_PACKAGE TNotifyEvent WakeMainThread;


Type Visibility Source Unit Parent
variable public
System.Classes System.Classes


Represents a method (event handler) that is forced into the main thread's queue.

Assign a method to WakeMainThread before calling a thread's Synchronize method. When you call a thread's Synchronize method, it calls the method assigned to WakeMainThread once it has obtained a lock on the main GUI thread. This allows other threads to quickly synchronize with the GUI thread even if no events are being processed due to an idle state.

Warning: Only set WakeMainThread from the application's main thread. This variable should never be set by a secondary thread while another thread's Synchronize method is executing.

See Also