Am 19.07.2015 18:33 schrieb "kapibara" <kapibara....@aol.com>: > > Hi guys > > A number of threads need to access an object, but no more than three threads must access simultaneously. > > Thats a job for a semaphore someone said. I understand that under Delphi and Windows something like this could be used: > > FSemaphoreHandle := CreateSemaphore(nil, 3, 3, nil); > WaitForSingleObject(FSemaphoreHandle, <timeout>); > > How to do that under Lazarus and Linux? > > I have found TThreadManager with its SemaphoreInit and SemaphoreWait etc. But how to use it, especially how do you specify the number of threads that can access the object? > > Using 32 bit Lazarus trunk and FPC trunk.
FPC does not yet have a public semaphore API. The functions in TThreadManager are only implemented on Unix systems ans only used for specific purposes inside the RTL. Regards, Sven
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus