mirror of
https://github.com/apache/nuttx.git
synced 2026-10-06 22:05:21 +00:00
semaphore/sem_trywait.c: Remove redundancy leave_critical_section
Remove redundant leave_critical_section() call in nxsem_trywait_slow() as the critical section is properly released at the exit point via 'out' label, making the intermediate call unnecessary and eliminating code duplication. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
0b96303fda
commit
37ecb28eb1
1 changed files with 0 additions and 1 deletions
|
|
@ -118,7 +118,6 @@ int nxsem_trywait_slow(FAR sem_t *sem)
|
|||
atomic_fetch_add(NXSEM_COUNT(sem), 1);
|
||||
}
|
||||
|
||||
leave_critical_section(flags);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue