mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
pthread: remove enter_critical_section in pthread_barrier_wait
reason: We decouple semcount from business logic by using an independent counting variable, which allows us to remove critical sections in many cases. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -87,6 +87,8 @@ int pthread_barrier_init(FAR pthread_barrier_t *barrier,
|
||||
{
|
||||
sem_init(&barrier->sem, 0, 0);
|
||||
barrier->count = count;
|
||||
barrier->wait_count = 0;
|
||||
nxmutex_init(&barrier->mutex);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user