[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'InterfaceBase' (#lcl)

TWidgetSet.InitializeCriticalSection

Initializes a Critical Section object.

Declaration

Source position: winapih.inc line 170

public procedure TWidgetSet.InitializeCriticalSection(

  var CritSection: TCriticalSection

); virtual;

Arguments

CritSection

  

The critical section object.

Description

Critical sections are thread synchronization elements, typically used to prevent concurrent access to a shared resource.

Only one thread can own a critical section at the same time, other requests (to enter the same critical section) are delayed until the owner has left the critical section.

The TCriticalSection type is platform specific, treat it like a Handle.

See also

TWidgetSet.EnterCriticalSection

  

Enters a critical section.

TWidgetSet.TryEnterCriticalSection

TWidgetSet.LeaveCriticalSection

  

Releases a critical section, for use by other threads.

TWidgetSet.DeleteCriticalSection

  

Deletes an unowned critical section.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.