JCL Help:LockedDec@Int64

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Thread safe decrement.


Pascal

 function LockedDec(var Target: Integer): Integer; overload;
function LockedDec(var Target: Int64): Int64; overload;
function LockedDec(var Target: NativeInt): NativeInt; overload;


Parameters

Parameters Description
var Target: Integer The variable to decrement.


Return Value

The value of Target after being decremented. Note that the actual value of the variable may have already changed!


Description

LockedDec decrements the specified Integer in an atomic, thread-safe manner. The LockedXxx functions allow for a simple and efficient way for applications to synchronize access to and manipulate integer variables which are shared by multiple threads.


See Also

LockedAdd LockedSub LockedExchange LockedInc


About

Unit

JclSynch


Donator

Azret Botash


Notes

The Win32 API provides similar functions. Look up InterlockedXxx in the Platform SDK.


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page