mthr_resume - resume a thread's execution
int mthr_suspend(mthread_p tp, int wait);
void mthr_resume(mthread_p tp);
If tp is equal to the calling thread's handle, the calling thread is suspended and another thread will be scheduled.
If tp specifies another thread and this thread isn't currently running, it is suspended and the call returns. If the thread is running on another processor the behaviour of mthr_suspend() depends on the value of wait. If wait is null, the requested thread will be marked for suspension. When it triggers a new scheduling decision for its processor it will be suspended. If wait has a value that's not null, the calling thread will be blocked until the suspension has actually occured.
Calls to mthr_suspend() accumulate, i.e. each call to mthr_suspend() needs a corresponding call to mthr_resume() to resume the thread and vice versa. If mthr_resume() has been called before mthr_suspend(), no suspension will happen but mthr_suspend() will return.
mthr_resume will resume a thread's execution if there have been less calls to mthr_suspend() than calls to mthr_resume(). Calls to mthr_resume() also accumulate.