[En-Nut-Discussion] Feature Request 1572837: mutex API nesting level info

Matthias Ringwald mringwal at inf.ethz.ch
Fri Jul 18 10:28:01 CEST 2008


On 14.07.2008, at 21:43, Alain M. wrote:
>
> The "normal" way of controling re-entrancy is to have a mutex + a
> counter, no standard simpler way. In Nut, NutEnterCritical() can be
> lighter, but it may depend on the application.

Hi. I hope you all know, that NutEnterCritical is ONLY for critical  
sections and...
If you do any i/o, e.b. printf,.. there could be thread switch and the  
interrupts will be re-enabled.
So only use it for a very short section and don't think it helps with  
other THREADS.

If you do no I/O and don't call any NutEventWait... there will be no  
other thread by concept, hence
no need for NutEnterCritical().

Matthias



More information about the En-Nut-Discussion mailing list