[ECOS] Is it possible to post semaphore in an interrupt handler ?

Gary D. Thomas gary.thomas@mind.be
Fri Feb 21 19:56:00 GMT 2003


On Fri, 2003-02-21 at 12:53, Philippe Vandermersch wrote:
> Hi,
> 
> It looks like it is not safe to post a semaphore while under interrupt.
> It seems that there is a race condition if a thread is doing a sem_get
> at the same time.
> 
> If in my thread, I disable interrupt before to access any semaphore, it
> seems to work pretty well.
> 
> Any comments ?

You should not have to disable interrupts to post semaphores.

That said, you cannot post a semaphore from ISR, only DSR code.
Check the documentation and archives - this has been discussed
a lot previously.

-- 
.--------------------------------------------------------.
|       Mind: Embedded Linux and eCos Development        |
|--------------------------------------------------------|
| Gary Thomas              email:  gary.thomas@mind.be   |
| Mind ( http://mind.be )  tel:    +1 (970) 229-1963     |
| gpg: http://www.chez-thomas.org/gary/gpg_key.asc       |
'--------------------------------------------------------'


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list