SYSCALL ER rel_wai(ID tskid) { TCB *tcb; ER ercd; LOG_REL_WAI_ENTER(tskid); CHECK_TSKCTX_UNL(); CHECK_TSKID(tskid); tcb = get_tcb(tskid); t_lock_cpu(); if (!(TSTAT_WAITING(tcb->tstat))) { ercd = E_OBJ; } else { if (wait_release(tcb)) { dispatch(); } ercd = E_OK; } t_unlock_cpu(); exit: LOG_REL_WAI_LEAVE(ercd); return(ercd); }
ER rel_wai(ID tskid) { TCB *p_tcb; ER ercd; LOG_REL_WAI_ENTER(tskid); CHECK_TSKCTX_UNL(); CHECK_TSKID(tskid); p_tcb = get_tcb(tskid); t_lock_cpu(); if (p_tcb->p_tinib->tskatr == TA_NOEXS) { ercd = E_NOEXS; } else if (VIOLATE_ACPTN(p_tcb->p_tinib->acvct.acptn2)) { ercd = E_OACV; } else if (!TSTAT_WAITING(p_tcb->tstat)) { ercd = E_OBJ; } else { if (wait_release(p_tcb)) { dispatch(); } ercd = E_OK; } t_unlock_cpu(); error_exit: LOG_REL_WAI_LEAVE(ercd); return(ercd); }
ER rel_wai(ID tskid) { TCB *p_tcb; ER ercd; LOG_REL_WAI_ENTER(tskid); CHECK_UNL(); CHECK_ID(VALID_TSKID(tskid)); p_tcb = get_tcb(tskid); lock_cpu(); if (p_tcb->p_tinib->tskatr == TA_NOEXS) { ercd = E_NOEXS; } else if (!TSTAT_WAITING(p_tcb->tstat)) { ercd = E_OBJ; } else { wait_dequeue_wobj(p_tcb); wait_dequeue_tmevtb(p_tcb); p_tcb->p_winfo->wercd = E_RLWAI; make_non_wait(p_tcb); if (p_runtsk != p_schedtsk) { if (!sense_context()) { dispatch(); } else { request_dispatch(); } } ercd = E_OK; } unlock_cpu(); error_exit: LOG_REL_WAI_LEAVE(ercd); return(ercd); }