command-delphi
command-delphi copied to clipboard
Async Command - property ThreadSafeObject
type TAsyncCommand = class(TCommand)
property ThreadSafeObject: TObject
read GetThreadSafeObject
write SetThreadSafeObject;
function TAsyncCommand GetThreadSafeObject: TObject;
begin
TMonitor.Enter(Self);
try
Result := fThreadSafeObject;
finally
TMonitor.Exit(Self);
end;
end;