doc: add detailed scheduler documentation

Maybe add `thread_sleep()` and `msg_receive()` as examples for the latter cases.