In a uni-processor such as the STM32, threads are executed in an interleaved manner with access to the processor controlled by a scheduler. Whenever an interrupt occurs, there is an opportunity to suspend the current thread and resume a blocked thread.