* fix test: TThread.WaitFor calls CheckSynchronize as well, so the thread needs to signal when it's done with removing entries from the queue

git-svn-id: trunk@47084 -
This commit is contained in:
svenbarth 2020-10-11 12:38:16 +00:00
parent 56c58b517d
commit 2f877218b4

View File

@ -29,6 +29,7 @@ begin
end;
var
e: PRTLEvent;
t1, t2: TTest;
procedure TTestThread.Execute;
@ -46,17 +47,23 @@ begin
{ should remove only one }
RemoveQueuedEvents(@t1.DoTest);
RTLEventSetEvent(e);
end;
var
t: TTestThread;
begin
e := Nil;
t := TTestThread.Create(True);
try
e := RTLEventCreate;
t1 := TTest.Create;
t2 := TTest.Create;
t.Start;
RTLEventWaitFor(e);
t.WaitFor;
CheckSynchronize;
@ -67,6 +74,7 @@ begin
t1.Free;
t2.Free;
t.Free;
RTLEventDestroy(e);
end;
end.