[Overview][Types][Classes][Index] Reference for unit 'LazCollections' (#lazutils)

TWaitableSection

Protects a section of code in multi-threaded applications.

Declaration

Source position: lazcollections.pas line 27

type TWaitableSection = record

public

  function GetCachedOrNewEvent();

  

Gets or creates the RTL event for the synchronization object.

  procedure FreeOrCacheEvent();

  

Caches or Frees the RTL event for the synchronization object.

  function EnterOrWait();

  

Enters the protected section, or waits until it is available.

  procedure Leave;

  

Leaves the protected section.

end;

Description

TWaitableSection is an advanced record type used to serialize access to a section of code in a multi-threaded application. It uses a pointer to a RTL event, accessible to all interested threads, to protect its resources. When the event is set by an acquiring thread, other threads must wait until the event is reset.

TWaitableSection is used in the implementation of the Dwarf debugger for the Lazarus IDE.

See also

PPRTLEvent

  

Pointer to a PRTLEvent type.

PRTLEvent


Version 4.0 Generated 2025-05-03 Home