Delphi multi-threading file write: I/O error 32
问题 I created a class for writing thread-safe log in a text file using CriticalSection . I am not an expert of CriticalSection and multi-threading programming (...and Delphi), I'm definitely doing something wrong... unit ErrorLog; interface uses Winapi.Windows, System.SysUtils; type TErrorLog = class private FTextFile : TextFile; FLock : TRTLCriticalSection; public constructor Create(const aLogFilename:string); destructor Destroy; override; procedure Write(const ErrorText: string); end;