sem: remove the additional assignment.

reason:
running tcb->waitobj should be NULL

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5
2024-12-12 15:35:04 +08:00
committed by Xiang Xiao
parent f66c4a0733
commit f301524cb9
2 changed files with 2 additions and 5 deletions
-3
View File
@@ -62,7 +62,6 @@
static int nxsem_trywait_slow(FAR sem_t *sem) static int nxsem_trywait_slow(FAR sem_t *sem)
{ {
FAR struct tcb_s *rtcb;
irqstate_t flags; irqstate_t flags;
int32_t semcount; int32_t semcount;
int ret; int ret;
@@ -72,7 +71,6 @@ static int nxsem_trywait_slow(FAR sem_t *sem)
*/ */
flags = enter_critical_section(); flags = enter_critical_section();
rtcb = this_task();
/* If the semaphore is available, give it to the requesting 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); nxsem_add_holder(sem);
rtcb->waitobj = NULL;
/* Interrupts may now be enabled. */ /* Interrupts may now be enabled. */
+2 -2
View File
@@ -70,7 +70,7 @@
static int nxsem_wait_slow(FAR sem_t *sem) static int nxsem_wait_slow(FAR sem_t *sem)
{ {
FAR struct tcb_s *rtcb = this_task(); FAR struct tcb_s *rtcb;
irqstate_t flags; irqstate_t flags;
int ret; int ret;
@@ -98,7 +98,6 @@ static int nxsem_wait_slow(FAR sem_t *sem)
} }
nxsem_add_holder(sem); nxsem_add_holder(sem);
rtcb->waitobj = NULL;
} }
/* The semaphore is NOT available, We will have to block the /* 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 #ifdef CONFIG_PRIORITY_INHERITANCE
uint8_t prioinherit = sem->flags & SEM_PRIO_MASK; uint8_t prioinherit = sem->flags & SEM_PRIO_MASK;
#endif #endif
rtcb = this_task();
/* First, verify that the task is not already waiting on a /* First, verify that the task is not already waiting on a
* semaphore * semaphore