Bugfix: There is no thread safety mechanism in Zeos for the SQL log, so implement one in HeidiSQL. This should speed up async queries tremendously, as they no longer have to wait for the GUI to repaint before firing the actual query. Haven't bothered thinking about thread safety around the creation of the critical section protecting the TStringList, mainly because I'm infinitely annoyed by Delphi not providing a thread-safe list capable of holding lists OOTB..

This commit is contained in:
rosenfield
2007-10-08 21:29:16 +00:00
parent 1581c55cea
commit 74074fe633
3 changed files with 42 additions and 2 deletions

View File

@ -195,6 +195,7 @@ type
procedure ExecuteRemoteNonQuery(sender: THandle; query: string);
procedure HandleWMComplete(var msg: TMessage); message WM_COMPLETED;
procedure HandleWMCopyData(var msg: TWMCopyData); message WM_COPYDATA;
procedure HandleWMProcessLog(var msg: TMessage); message WM_PROCESSLOG;
private
function GetChildwin: TMDIChild;
public
@ -276,6 +277,11 @@ begin
HandleWMCopyDataMessage(msg);
end;
procedure TMainForm.HandleWMProcessLog(var msg: TMessage);
begin
ChildWin.ProcessSqlLog;
end;
procedure TMainForm.EnsureConnected;
begin
if ActiveMDIChild = nil then raise Exception.Create('Not connected.');