[fpc-pascal] Semaphore

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Feb 12 15:47:20 CET 2008


On 12 Feb 2008, at 15:43, Damien Gerard wrote:

> Ok thanks ! I ve got all I need to use Semaphore, except one thing :  
> How I set the limit ?
> I mean I want to restrict to 4 concurrent accesses to a shared  
> ressource.
>
> With pthread I have
> int sem_init(sem_t *sem, int pshared, unsigned int value);
>
> but here we have only
> TSempahoreInitHandler     = function: Pointer;
>
> Sorry I have for sure missed something :)

Call SemaphorePost 4 times after initialising it.


Jonas



More information about the fpc-pascal mailing list