static int pipe_cond_wait (thread_cond_t *condp, thread_critsect_t *csp, struct sys_thread *td, const msec_t timeout) { int res; sys_vm2_leave(td); res = thread_cond_wait_nolock(condp, csp, timeout); sys_vm2_enter(td); return res; }
static int thread_cond_wait_vm (thread_cond_t *condp, struct sys_thread *td, const msec_t timeout) { int res; #if defined(USE_PTHREAD_SYNC) sys_vm2_preleave(td); res = thread_cond_wait_nolock(condp, td->vmcsp, timeout); sys_vm2_postenter(td); #else sys_vm2_leave(td); res = thread_handle_wait(*condp, timeout); sys_vm2_enter(td); #endif return res; }