Skip to content

Commit d975d7c

Browse files
committed
* Isolamento de log em uma thread própria.
1 parent a7ba0b8 commit d975d7c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

log/lazarus/Log.TextFile.pas

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ TLog = class(TThread)
2020
FSection: string;
2121
FValue: string;
2222
protected
23+
procedure doLog;
2324
procedure Execute; override;
2425
public
2526
constructor Create(ASection, AValue, AFileName: string);
@@ -46,7 +47,7 @@ destructor TLog.Destroy;
4647
inherited Destroy;
4748
end;
4849

49-
procedure TLog.Execute;
50+
procedure TLog.doLog;
5051
var
5152
FLogFile: Text;
5253
logdata: string;
@@ -75,6 +76,11 @@ procedure TLog.Execute;
7576
end;
7677
end;
7778

79+
procedure TLog.Execute;
80+
begin
81+
Synchronize(@doLog);
82+
end;
83+
7884
class procedure TLog.Log(ASection, AValue: string; AFileName: string);
7985
begin
8086
Create(ASection, AValue, AFileName);

0 commit comments

Comments
 (0)