rtems_semaphore_obtain

Eric Norum norume at aps.anl.gov
Tue Mar 20 20:18:45 UTC 2007


On Mar 20, 2007, at 2:39 PM, Chris Xenophontos wrote:

> The first change I've made is to create a Counting Semaphore, i.e,  
> changed
> the attributes of the semaphore in question from:
>
> ( RTEMS_FIFO |
>   RTEMS_NO_INHERIT_PRIORITY |
>   RTEMS_SIMPLE_BINARY_SEMAPHORE |
>   RTEMS_NO_PRIORITY_CEILING |
>   RTEMS_LOCAL ),
>
> to:
>
> ( RTEMS_FIFO |
>   RTEMS_NO_INHERIT_PRIORITY |
>   RTEMS_COUNTING_SEMAPHORE  |
>   RTEMS_NO_PRIORITY_CEILING |
>   RTEMS_LOCAL ),
>
> I have to let it run like this another 18 hours to see if there is any
> change.
>
> If I understand your comments, Binary Semaphores should not be  
> called from
> ISRs?

Sergei -- Are you perhaps confusing Binary Semaphores with Simple  
Binary Semaphores?
Simple binary semaphores do not have the "unlock only by locking  
thread" restriction -- if they did then Chris's program would never  
work at all.
I don't see why it should be illegal to release a simple binary  
semaphore from an interrupt handler.

BTW -- I usually use events to unblock tasks waiting for interrupts.

-- 
Eric Norum <norume at aps.anl.gov>
Advanced Photon Source
Argonne National Laboratory
(630) 252-4793





More information about the users mailing list