sem: remove the additional assignment.
reason: running tcb->waitobj should be NULL Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
f66c4a0733
commit
f301524cb9
2 changed files with 2 additions and 5 deletions
|
@ -62,7 +62,6 @@
|
|||
|
||||
static int nxsem_trywait_slow(FAR sem_t *sem)
|
||||
{
|
||||
FAR struct tcb_s *rtcb;
|
||||
irqstate_t flags;
|
||||
int32_t semcount;
|
||||
int ret;
|
||||
|
@ -72,7 +71,6 @@ static int nxsem_trywait_slow(FAR sem_t *sem)
|
|||
*/
|
||||
|
||||
flags = enter_critical_section();
|
||||
rtcb = this_task();
|
||||
|
||||
/* If the semaphore is available, give it to the requesting task */
|
||||
|
||||
|
@ -99,7 +97,6 @@ static int nxsem_trywait_slow(FAR sem_t *sem)
|
|||
}
|
||||
|
||||
nxsem_add_holder(sem);
|
||||
rtcb->waitobj = NULL;
|
||||
|
||||
/* Interrupts may now be enabled. */
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
static int nxsem_wait_slow(FAR sem_t *sem)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = this_task();
|
||||
FAR struct tcb_s *rtcb;
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
|
@ -98,7 +98,6 @@ static int nxsem_wait_slow(FAR sem_t *sem)
|
|||
}
|
||||
|
||||
nxsem_add_holder(sem);
|
||||
rtcb->waitobj = NULL;
|
||||
}
|
||||
|
||||
/* The semaphore is NOT available, We will have to block the
|
||||
|
@ -110,6 +109,7 @@ static int nxsem_wait_slow(FAR sem_t *sem)
|
|||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
uint8_t prioinherit = sem->flags & SEM_PRIO_MASK;
|
||||
#endif
|
||||
rtcb = this_task();
|
||||
|
||||
/* First, verify that the task is not already waiting on a
|
||||
* semaphore
|
||||
|
|
Loading…
Reference in a new issue