> > Now when the original task releases the lock again, the other task can> > take it just like it does on mainline.> > Now interleave it with a third task of even higher priority that puts> the spinner to sleep.

So? It will eventually have to allow the task to run. Adding a "thirdhigher priority" task can cause problems in any other part of the -rtkernel.

We don't need to worry about priority inversion. If the higher taskblocks on the original task, it will boost its priority (even if it doesthe adaptive spin) which will again boost the task that it preempted.

Now we may need to add a sched_yield() in the adaptive spin to let theother task run.