priority order violation when calling chSysUnlock from virtual timer callback
Posted: Tue Oct 10, 2017 8:04 am
Hi,
I am trying to do a mutex lock inside the virtual timer callback set using chVTSet method. But I see that from the chSysUnlock i.e. called from while being inside the callback for mutex lock leads to debug error, Priority order violation. the value of ch.rlist.current is idle_thread context and the value of next is the thread which I created from which the chVTSet was called and has priority of 181. I am trying to understand is it illegal to do locks inside virtual timer callbacks, which doesn't seem so from example codes as you are calling function which do critical sections from the callbacks. So why I am having this issue.
Regards,
Siddharth
I am trying to do a mutex lock inside the virtual timer callback set using chVTSet method. But I see that from the chSysUnlock i.e. called from while being inside the callback for mutex lock leads to debug error, Priority order violation. the value of ch.rlist.current is idle_thread context and the value of next is the thread which I created from which the chVTSet was called and has priority of 181. I am trying to understand is it illegal to do locks inside virtual timer callbacks, which doesn't seem so from example codes as you are calling function which do critical sections from the callbacks. So why I am having this issue.
Regards,
Siddharth