[ECOS] why is it wrong to call cyg_semaphore_post() in ISR???

Monica Dsz monica.dsz@googlemail.com
Fri Jun 9 09:43:00 GMT 2006


> Normally, you try not to disable interrupts in RTOS's. You should
> protect your critical regions with mutex's, semaphores etc.
>

I remember well that I(we in our company) have used intLock () in VxWorks to 
make sure that interrupt doesnt during some critical sections. Ofcourse we 
did use semaphores and mutexes to guard against other threads but as far as 
I remember i never used semaphores/mutexes to guard against interrupts.

    lockKey = intLock ();

     ... (work with interrupts locked out)

    intUnlock (lockKey);
Seems in eCos we dont need to disable interrupts because interrupts doesnt 
perform any kernal calls and we can use DSR to give semaphores and etcthank 
you 


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



More information about the Ecos-discuss mailing list