Maintain legacy RTOS behavior before mbed-5

Fork of mbed-rtos by mbed official

unknown revision 'da6095f402b1'