[fpc-pascal] RTL semaphore supported?

Tomas Hajny XHajT03 at hajny.biz
Thu Aug 13 09:44:28 CEST 2020


On 2020-08-13 07:42, Sven Barth via fpc-pascal wrote:
> Am 13.08.2020 um 06:36 schrieb Ryan Joseph via fpc-pascal:
>> Are semaphores actually supported in the RTL? I don't see they're 
>> available on macOS (compiling with trunk even).
>> 
>> https://www.freepascal.org/docs-html/3.0.0/rtl/system/semaphoreinit.html
> 
> No, these functions where there only temporary. The RTL functionality
> for semaphores was only ever implemented for *nix systems, but not for
> Windows and was only used internally in the System unit, but even that
> changed some years ago, thus it was decided to remove it.
> 
> The way to go with semaphores would be to implement the Delphi
> compatible TSemaphore in the unit SyncObjs.

Well, there's the functionality related to events (= event semaphores) - 
BasicEvent* / RTLEvent*, and there's also the functionality of critical 
sections (*CriticalSection) which is basically a mutex semaphore. 
Obviously, that doesn't contradict the intention to provide the 
functionality in SyncObjs in Delphi compatible way.

Tomas


More information about the fpc-pascal mailing list