This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Does tsk_lock clear pending interrupt flag?

Hi everybody,
I have a question related to implementation of tsk_lock() for Cortex-M3. The manual says that the function disables the timer interrupt and thus prevents the RTOS from switching. But disabling the interrupt and clearing a pending interrupt flag are sometimes completely different things. Calling tsk_lock() and immediately after it calling tsk_ulock() should not drastically modify application behavior. What we found is that if the timer interrupt is due to happen between the calls of tsk_lock and tsk_unlock, the interrupt will be lost regardless of how quickly you call tsk_unlock. Which to me is an error - the tsk_lock should only disable the interrupt but keep the pending flag, so that the ISR is called immediately after tsk_unlock. Otherwise tasks that are waiting on os_dly_wait will miss a beat. Which is what we see.
Can anybody comment on it and tell me if this is how it was designed?
Thanks.

0