[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to reset semaphore



Leon Pollak <leonp at plris.com> writes:
> Hello, all.
>
> I searched the UM and did not find something suitable.
>
> I have a counting semaphore. At some point I have the situation when I need to 
> reset the counter (to zero).
>
> How can I do this if I do not want to delete it (too complicated - its ID is 
> known and used by the whole system)?

while(rtems_semaphore_obtain(id, RTEMS_NO_WAIT, 0) == RTEMS_SUCCESSFUL)
   continue;

-- Sergei.