When investigating issue #5719 it became clear that the pause_thread() kernel call violates an assumption. That is: the currently active thread of a cpu is removed from the scheduler (deactivated) only by the very same cpu kernel context. This violation can lead to the corruption of the "idle" threads register set. The solution to this issue should be to:
- Enhance detection of such violation
- Add a test that stresses
pause_thread() in a cross-cpu fashion
- Prevent the corruption of "idle" threads register set in general
- Fix the
pause_thread() implementation