[Overview][Constants][Types][Classes][Procedures and functions][Variables] | Reference for unit 'System' (#rtl) |
Conditional exchange
Source position: line 0
function InterlockedCompareExchange( |
var Target: LongInt; |
NewValue: LongInt; |
Comperand: LongInt |
):LongInt; |
var Target: Pointer; |
NewValue: Pointer; |
Comperand: Pointer |
):Pointer; |
InterlockedCompareExchange does an compare-and-exchange operation on the specified values in a thread-safe way. The function compares Target and Comparand and exchanges Target with NewValue if Target and Comparand are equal. It returns the old value of Target. This is done in a thread-safe way, i.e., only one processor is accessing the Target variable at a time.
None.
|
Thread-safe decrement |
|
|
Thread-safe increment |
|
|
Exchange 2 integers in a thread-safe way |
|
|
Thread-safe add and exchange of 2 values |
No notes exist for this page yet.