sched: clear waitsem and msgwaitq after remove blocked
This commit is contained in:
parent
af72a528f1
commit
40366f4153
@ -303,7 +303,6 @@ ssize_t nxmq_do_receive(FAR struct mqueue_inode_s *msgq,
|
||||
wd_cancel(&btcb->waitdog);
|
||||
}
|
||||
|
||||
btcb->waitobj = NULL;
|
||||
msgq->nwaitnotfull--;
|
||||
up_unblock_task(btcb);
|
||||
}
|
||||
|
@ -410,7 +410,6 @@ int nxmq_do_send(FAR struct mqueue_inode_s *msgq,
|
||||
wd_cancel(&btcb->waitdog);
|
||||
}
|
||||
|
||||
btcb->waitobj = NULL;
|
||||
msgq->nwaitnotempty--;
|
||||
up_unblock_task(btcb);
|
||||
}
|
||||
|
@ -83,8 +83,6 @@ void nxmq_wait_irq(FAR struct tcb_s *wtcb, int errcode)
|
||||
msgq = wtcb->waitobj;
|
||||
DEBUGASSERT(msgq);
|
||||
|
||||
wtcb->waitobj = NULL;
|
||||
|
||||
/* Decrement the count of waiters and cancel the wait */
|
||||
|
||||
if (wtcb->task_state == TSTATE_WAIT_MQNOTEMPTY)
|
||||
|
@ -67,6 +67,10 @@ void nxsched_remove_blocked(FAR struct tcb_s *btcb)
|
||||
|
||||
dq_rem((FAR dq_entry_t *)btcb, TLIST_BLOCKED(task_state));
|
||||
|
||||
/* Indicate that the wait is over. */
|
||||
|
||||
btcb->waitobj = NULL;
|
||||
|
||||
/* Make sure the TCB's state corresponds to not being in
|
||||
* any list
|
||||
*/
|
||||
|
@ -155,10 +155,6 @@ int nxsem_post(FAR sem_t *sem)
|
||||
|
||||
wd_cancel(&stcb->waitdog);
|
||||
|
||||
/* It is, let the task take the semaphore */
|
||||
|
||||
stcb->waitobj = NULL;
|
||||
|
||||
/* Restart the waiting task. */
|
||||
|
||||
up_unblock_task(stcb);
|
||||
|
@ -97,10 +97,6 @@ void nxsem_wait_irq(FAR struct tcb_s *wtcb, int errcode)
|
||||
|
||||
sem->semcount++;
|
||||
|
||||
/* Indicate that the semaphore wait is over. */
|
||||
|
||||
wtcb->waitobj = NULL;
|
||||
|
||||
/* Mark the errno value for the thread. */
|
||||
|
||||
wtcb->errcode = errcode;
|
||||
|
Loading…
Reference in New Issue
Block a user