//once priority void thread_resume(struct thread *th) { CPU_SR_ALLOC(); CPU_INT_DIS(); th->suspend_timeout = 0; /* th->resume_cnt = (th->resume_cnt == 255) ? 255 : th->resume_cnt+1; */ th->resume_cnt = 1; thread_ins->os_resume(th->priority); CPU_INT_EN(); }
//should wait all priority void thread_suspend(struct thread *th, int timeout) { CPU_SR_ALLOC(); CPU_INT_DIS(); th->suspend_timeout = timeout; //suspend now if (timeout == 0) { /* th->resume_cnt = (th->resume_cnt) ? th->resume_cnt-1 : 0; */ th->resume_cnt = 0; } CPU_INT_EN(); }
/*----------------------------------------------------------------------* rtp_irq_enable *----------------------------------------------------------------------*/ void rtp_irq_enable(void) { CPU_INT_EN(); }