mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
sem: remove the additional assignment.
reason: running tcb->waitobj should be NULL Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -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. */
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user