Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.306 Beiträge
Delphi 12 Athens
|
AW: InterlockedIncrement in welcher Unit?
30. Okt 2024, 13:59
Das hieße ja dass ich die Klasse TInterlocked nicht erst instanziieren muss?
Natürlich nicht, denn
Delphi-Quellcode:
TInterlocked = class sealed
public
class function Increment(var Target: Integer): Integer; overload; static; inline;
class function Increment(var Target: Int64): Int64; overload; static; inline;
(man beachte das CLASS)
Delphi-Quellcode:
var MyVar: Integer;
AtomicIncrement(MyVar); // die System.pas ist immer eingebunden
InterlockedIncrement(MyVar); // Winapi.Windows.pas
TInterlocked.Increment(MyVar); // System.SyncObjs.pas
Ein Therapeut entspricht 1024 Gigapeut.
|