mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 04:59:33 +02:00
* 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:
parent
56c58b517d
commit
2f877218b4
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user