[Lazarus] DebugLn thread safety

cobines cobines at gmail.com
Wed Mar 30 09:28:45 CEST 2011


It seems it is enough to protect the call to DebugLn with a critical section:

var
  cs: syncobjs.TCriticalSection;

procedure DebugLnThreadSafe(const s: String);
begin
  cs.Acquire;
  try
    DebugLn(s);
  finally
    cs.Release;
  end;
end;

--
cobines




More information about the Lazarus mailing list