void coopth_sched(void) { assert(_coopth_is_in_thread()); ensure_attached(); /* the check below means that we switch to DOS code, not dosemu code */ assert(get_scheduled() != coopth_get_tid()); switch_state(COOPTH_SCHED); }
void coopth_cancel(int tid) { struct coopth_t *thr; struct coopth_per_thread_t *pth; check_tid(tid); thr = &coopthreads[tid]; pth = current_thr(thr); if (_coopth_is_in_thread_nowarn()) assert(tid != coopth_get_tid()); do_cancel(thr, pth); }
void coopth_cancel(int tid) { struct coopth_t *thr; struct coopth_per_thread_t *pth; check_tid(tid); thr = &coopthreads[tid]; pth = current_thr(thr); if (_coopth_is_in_thread_nowarn()) { if (tid == coopth_get_tid()) { assert(pth->data.left); return; } } do_cancel(thr, pth); }