ER dly_tsk(RELTIM dlytim) { WINFO winfo; TMEVTB tmevtb; ER ercd; LOG_DLY_TSK_ENTER(dlytim); CHECK_DISPATCH(); CHECK_PAR(VALID_RELTIM(dlytim)); lock_cpu_dsp(); if (p_runtsk->raster) { ercd = E_RASTER; } else { p_runtsk->tstat = TS_WAITING_DLY; make_non_runnable(p_runtsk); p_runtsk->p_winfo = &winfo; winfo.p_tmevtb = &tmevtb; tmevtb.callback = (CBACK) wait_tmout_ok; tmevtb.arg = (void *) p_runtsk; tmevtb_enqueue(&tmevtb, dlytim); LOG_TSKSTAT(p_runtsk); dispatch(); ercd = winfo.wercd; } unlock_cpu_dsp(); error_exit: LOG_DLY_TSK_LEAVE(ercd); return(ercd); }
SYSCALL ER dly_tsk(RELTIM dlytim) { WINFO winfo; TMEVTB tmevtb; ER ercd; LOG_DLY_TSK_ENTER(dlytim); CHECK_DISPATCH(); CHECK_PAR(dlytim <= TMAX_RELTIM); t_lock_cpu(); runtsk->tstat = TS_WAITING; make_non_runnable(runtsk); runtsk->winfo = &winfo; winfo.tmevtb = &tmevtb; tmevtb_enqueue(&tmevtb, dlytim, (CBACK) wait_tmout_ok, (VP) runtsk); LOG_TSKSTAT(runtsk); dispatch(); ercd = winfo.wercd; t_unlock_cpu(); exit: LOG_DLY_TSK_LEAVE(ercd); return(ercd); }
ER dly_tsk(RELTIM dlytim) { WINFO winfo; TMEVTB tmevtb; ER ercd; LOG_DLY_TSK_ENTER(dlytim); CHECK_DISPATCH(); CHECK_PAR(dlytim <= TMAX_RELTIM); t_lock_cpu(); if (p_runtsk->waifbd) { ercd = E_RLWAI; } else { p_runtsk->tstat = (TS_WAITING | TS_WAIT_DLY); (void) make_non_runnable(p_runtsk); p_runtsk->p_winfo = &winfo; winfo.p_tmevtb = &tmevtb; tmevtb_enqueue(&tmevtb, dlytim, (CBACK) wait_tmout_ok, (void *) p_runtsk); LOG_TSKSTAT(p_runtsk); dispatch(); ercd = winfo.wercd; } t_unlock_cpu(); error_exit: LOG_DLY_TSK_LEAVE(ercd); return(ercd); }