Fix softtimer resume (#8393)

This commit is contained in:
geniusgogo
2023-12-24 19:55:04 +08:00
committed by GitHub
parent e1fdc13288
commit 20a4d0939a
2 changed files with 22 additions and 21 deletions
+4 -2
View File
@@ -1059,16 +1059,18 @@ rt_err_t rt_thread_resume(rt_thread_t thread)
LOG_D("thread resume: %s", thread->parent.name);
level = rt_spin_lock_irqsave(&(thread->spinlock)); //TODO need lock for cpu
if ((thread->stat & RT_THREAD_SUSPEND_MASK) != RT_THREAD_SUSPEND_MASK)
{
rt_spin_unlock_irqrestore(&(thread->spinlock), level);
LOG_D("thread resume: thread disorder, %d",
thread->stat);
return -RT_ERROR;
}
level = rt_spin_lock_irqsave(&(thread->spinlock)); //TODO need lock for cpu
/* remove from suspend list */
rt_list_remove(&(thread->tlist));