Merge pull request #153 from dmitryryzhov/rtos-switch-active-thread