New tests for atomic ops

This commit is contained in:
Michael Schimmel
2025-06-03 19:49:48 +02:00
parent 556690fa5e
commit f438c91dbd
11 changed files with 511 additions and 951 deletions
+5 -5
View File
@@ -4,7 +4,7 @@ interface
uses
System.SysUtils, System.Classes, System.SyncObjs,
Myc.Core.Atomic, Myc.TaskManager, Myc.Signals; // Myc.Signals now requires direct use of TMycLatch static members
Myc.Core.Atomic, Myc.TaskManager, Myc.Signals;
type
IMycTaskFactory = interface( IMycTaskManager )
@@ -85,13 +85,13 @@ type
// Initialize global TaskManager
class procedure AquireTaskManager;
class procedure ReleaseTaskManager;
property ThreadsRunning: Integer read FThreadsRunning;
property WorkThreads: TArray<TThread> read FWorkThreads;
end;
implementation
uses
Myc.Core.Signals;
type
TMycPendingJob = class(TInterfacedObject, IMycSubscriber)
private
@@ -357,7 +357,7 @@ begin
if lock = nil then
lock := TSemaphore.Create(nil, 0, 1, '');
try
var subscription := State.Subscribe(TMycTaskWait.Create(lock));
{var subscription :=} State.Subscribe(TMycTaskWait.Create(lock));
lock.Acquire;
finally
FWaitSemaphores.Push(lock);