Probably OT, but someone was complaining to me the other day that
pthreads running on SCHED_FIFO/SCHED_RR that are blocked on mutexes
don't release in priority order. This was on a stock 2.6.18 kernel,
"recent glibc" (I didn't catch which version or config), ARM9 platform.
First question: Is this actually true?
Second question: Does Xenomai fix this? Do more recent kernel
developments fix this?
Point me at the appropriate RTFM or code if that's the appropriate
answer. :)
The appropriate RTFM is the POSIX spec [1]
In short, it says: "If there are threads blocked on the mutex object
referenced by 'mutex' when pthread_mutex_unlock() is called, resulting
in the mutex becoming available, the scheduling policy shall determine
which thread shall acquire the mutex."
So, the correct implementation is to release a mutex in priority order.