http://developer.mbed.org/teams/ST/code/mbed-rtos/#83895f30f8f2