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:
hujun5
2024-11-15 10:24:20 +08:00
committed by Xiang Xiao
parent 370eefb491
commit 7ba0f11d70
3 changed files with 14 additions and 42 deletions
+2
View File
@@ -368,6 +368,8 @@ struct pthread_barrier_s
{
sem_t sem;
unsigned int count;
unsigned int wait_count;
mutex_t mutex;
};
#ifndef __PTHREAD_BARRIER_T_DEFINED