mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 05:08:41 +08:00
remove sched_lock in pthread_cond_broadcast
reason: Since pthread_cond_broadcast is already protected by a mutex, even if sem_post causes a context switch, it will not affect the count of wait_count. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
fa9bf63faf
commit
2714f1b605
1 changed files with 0 additions and 11 deletions
|
@ -68,13 +68,6 @@ int pthread_cond_broadcast(FAR pthread_cond_t *cond)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Disable pre-emption until all of the waiting threads have been
|
||||
* restarted. This is necessary to assure that the sval behaves as
|
||||
* expected in the following while loop
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
|
||||
/* Loop until all of the waiting threads have been restarted. */
|
||||
|
||||
while (cond->wait_count > 0)
|
||||
|
@ -92,10 +85,6 @@ int pthread_cond_broadcast(FAR pthread_cond_t *cond)
|
|||
|
||||
cond->wait_count--;
|
||||
}
|
||||
|
||||
/* Now we can let the restarted threads run */
|
||||
|
||||
sched_unlock();
|
||||
}
|
||||
|
||||
sinfo("Returning %d\n", ret);
|
||||
|
|
Loading…
Reference in a new issue