mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 13:13:08 +08: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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user