Via [WayBack] TInterlocked.Exchange for interfaces? Since there is no System.SyncObjs.TInterlocked.Exchange overload for interfaces (and the Exchange versio… – Stefan Glienke – Google+
It has made it to this piece in [Archive.is] sglienke / Spring4D / source / Source / Reactive / Spring.Reactive.pas — Bitbucket:
class function TInterlockedHelper.Exchange<T>(var Target: T; const Value: T): T; begin Result := Default(T); PPointer(@Result)^ := Exchange(PPointer(@Target)^, PPointer(@Value)^); if Assigned(Value) then Value._AddRef; end;
It is similar to the TInterlocked.Exchange methods.
–jeroen