command-delphi icon indicating copy to clipboard operation
command-delphi copied to clipboard

Async Command - property ThreadSafeObject

Open bogdanpolak opened this issue 5 years ago • 0 comments

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;

bogdanpolak avatar Feb 09 '20 09:02 bogdanpolak