[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to reset semaphore
- Date: Thu, 19 Apr 2007 21:51:06 +0400
- From: osv at javad.com (Sergei Organov)
- Subject: How to reset semaphore
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.