Indy 9
TIdThreadSafeCardinal
Hierarchy, Properties, Methods, See Also, Unit: IdThreadSafe
Implements a thread-safe Cardinal data type.
TIdThreadSafeCardinal = class(TIdThreadSafe)
Unit
IdThreadSafe
Description
TIdThreadSafeCardinal is a TIdThreadSafe descendant that implements a thread-safe data type for storing a Cardinal value. TIdThreadSafeCardinal does not rely on "compiler magic" to guarantee that Cardinal operations are atomic, and is Operating System platform independent.

TIdThreadSafeCardinal relies on the inherited TCriticalSection for resource protection in multi-threaded applications. TIdThreadSafeCardinal implements the Value property for reading or writing the Cardinal value associated with the class instance with resource protection. TIdThreadSafeCardinal also implements methods that protect write access to Value using Increment and Decrement.


TIdThreadSafeCardinal.Value
TIdThreadSafeCardinal, See Also
Reads or Writes the value for the thread-safe data type.
property Value: Cardinal;
Description
Value is a Cardinal property that represents the value for the thread-safe Cardinal data type. Read and write access to the content of Value uses the resource protection capabilities of the object instance to insure reliable access in multi-threaded applications.

TIdThreadSafeCardinal.Decrement
TIdThreadSafeCardinal, See Also
Decreases the value for the thread-safe data type.
function Decrement: Cardinal;
Description
Decrement is a procedure used to decrease by 1 the value of the thread-safe Cardinal data type. Decrement calls Lock to enable the resource protection capabilities of the object instance prior to updating the associated Value for the data type. Decrement calls Unlock to disable resource protection when the value is successfully updated, or when an exception is raised.

Use Increment to increase by 1 the value of the thread-safe Cardinal data type.


TIdThreadSafeCardinal.Increment
TIdThreadSafeCardinal, See Also
Increases the value for the thread-safe data type.
function Increment: Cardinal;
Description
Increment is a procedure used to increase by 1 the value of the thread-safe Cardial data type. Increment calls Lock to enable the resource protection capabilities of the object instance prior to updating the associated value for the data type. Increment calls Unlock to disable resource protection when the value is successfully updated, or an exception is raised.

Use Decrement to decrease by 1 the value of the thread-safe Cardinal data type.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.