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
priority order violation when calling chSysUnlock from virtual timer callback
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: priority order violation when calling chSysUnlock from virtual timer callback
Hi,
It is illegal to do in callbacks/ISRs anything that can change the state of the current thread. In general, from callbacks/ISRs you can only call I-Class functions, those whose name is ended by "I".
The state checker, which you should enable, detects this kind of violations.
Giovanni
It is illegal to do in callbacks/ISRs anything that can change the state of the current thread. In general, from callbacks/ISRs you can only call I-Class functions, those whose name is ended by "I".
The state checker, which you should enable, detects this kind of violations.
Giovanni
Who is online
Users browsing this forum: No registered users and 35 guests