[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'tiUtils' (#tiopf)

TtiMultiReadExclusiveWriteSynchronizer

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

A thread-safe synchronizer class.

Declaration

Source position: tiUtils.pas line 602

type TtiMultiReadExclusiveWriteSynchronizer = class(TtiBaseObject) end;

protected

  function CanLockForWrite; virtual;

  function CanLockForRead; virtual;

public

  constructor Create;

  destructor Destroy; override;

  procedure BeginRead;

  procedure EndRead;

  procedure BeginWrite;

  procedure EndWrite;

Inheritance

TtiMultiReadExclusiveWriteSynchronizer

  

A thread-safe synchronizer class.

|

TtiBaseObject,IInterface

|

TObject

Description

Use TtiMultiReadExclusiveWriteSynchronizer to guard access to certain memory. Unlike a standard Critical Section that gives exclusive read or write access to memory, this synchronizer gives multiple read access, but exclusive write access (no other thread can read from the protected memory area while writing occurs).

So this class provides similar functionality to the VCL's TMultiReadSingleWriteSynchronizer, except that a Read can not be promoted to a Write. Also the VCL's version reports a memory leak under DUnit2, and this has been fixed in the tiOPF version.


Documentation generated on: 2017-08-16