[riot-devel] Mutex and thread priority

Baptiste Clenet bapclenet at gmail.com
Thu Nov 22 12:11:31 CET 2018


Hi,
I have looked at mutex.c and thread.c and I've understood that a
thread with higher priority (it has priority) will unlock the mutex
even if thread with lower priority has not finished/unlock the mutex?
Am I right?
Now, in my case, I use UART with ethos (which use a mutex) and what
happens on my case is:
* I have thread A (high priority), thread B (low priority)
* B starts to write on UART an long str
* A wants to write on UART an lock the mutex (ethos) but because it
has higher priority, it sends its message over UART until end of str
* B can continue and finish to send its str

So I'm wondering why a thread with higher priority should be able to
unlock a mutex locked by a thread with lower priorty?

Cheers

-- 
Baptiste


More information about the devel mailing list