LCL: comments

git-svn-id: trunk@26487 -
This commit is contained in:
mattias 2010-07-06 14:08:51 +00:00
parent c92522b37c
commit 0170b10fea
2 changed files with 8 additions and 4 deletions

View File

@ -1142,7 +1142,8 @@ type
Top, Last: PAsyncCallQueueItem;
end;
TAsyncCallQueues = record
Cur, Next: TAsyncCallQueue;
Cur: TAsyncCallQueue; // currently processing
Next: TAsyncCallQueue; // new calls added to this queue
end;
TApplicationType = (

View File

@ -994,7 +994,7 @@ var
Data: PtrInt;
begin
with FAsyncCall do begin
// move the items of NextQueue to CurQueue
// move the items of NextQueue to CurQueue, keep the order
if Next.Top<>nil then
begin
if Cur.Last<>nil then
@ -1011,21 +1011,24 @@ begin
Next.Last:=nil;
end;
// only process items from last to top in current queue
// this can create new items, which are added to the next queue
// process items from top to last in 'Cur' queue
// this can create new items, which are added to the 'Next' queue
// or it can call ProcessAsyncCallQueue, for example via calling
// Application.ProcesssMessages
while Cur.Top <> nil do
begin
// remove top item from queue
lItem:=Cur.Top;
Cur.Top := lItem^.NextItem;
if Cur.Top = nil then
Cur.Last := nil
else
Cur.Top^.PrevItem := nil;
// free item
Event:=lItem^.Method;
Data:=lItem^.Data;
Dispose(lItem);
// call event
Event(Data);
end;
end;