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