Implemented TLazy + Tests

This commit is contained in:
Michael Schimmel
2025-06-03 17:10:55 +02:00
parent 38c9e2830d
commit 254eb7b114
18 changed files with 1329 additions and 149 deletions
+3 -3
View File
@@ -150,7 +150,7 @@ begin
FWorkThreads[i].Free;
if Assigned(FException) then
FException.Free;
FException.Free;
FWorkGate.Free;
FWorkStack.Clear;
@@ -203,7 +203,7 @@ var
capturedProc: TProc;
begin
// Create a latch that will be signaled when the proc finishes
res := TMycLatch.CreateLatch(1); // Changed to use direct static call on TMycLatch
res := TLatch.Construct(1); // Changed to use direct static call on TMycLatch
capturedProc := Proc; // Capture Proc for the anonymous method
CreateAnonymousThread('Thread',
@@ -303,7 +303,7 @@ begin
raise ETaskException.Create('Task factory terminated');
if not Assigned(Job) then
exit(TMycLatch.Null); // Already correct, uses direct static property on TMycLatch
exit(TLatch.Null); // Already correct, uses direct static property on TMycLatch
// Create a pending job
Result := TMycPendingJob.Create(Self, Job);