[Overview][Types][Classes][Procedures and functions][Index] |
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
A thread-safe synchronizer class.
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; |
|
A thread-safe synchronizer class. |
|
| | ||
TtiBaseObject,IInterface |
||
| | ||
TObject |
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.