How to reset semaphore

Sergei Organov osv at javad.com
Thu Apr 19 17:51:06 UTC 2007


Leon Pollak <leonp at plris.com> writes:
> On Thursday 19 April 2007, Sergei Organov wrote:
>> 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.
> Thanks...:-))
>
> May be there some more fast solutions? :-))

This one is already amazingly fast ;)

-- Sergei.



More information about the users mailing list