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