hujun260 commented on code in PR #15566:
URL: https://github.com/apache/nuttx/pull/15566#discussion_r1917481997
##########
sched/pthread/pthread_condsignal.c:
##########
@@ -68,12 +66,16 @@ int pthread_cond_signal(FAR pthread_cond_t *cond)
}
else
{
- if (cond->wait_count > 0)
+ nxmutex_lock(&cond->mutex);
+
+ if (atomic_load(&cond->wait_count) > 0)
Review Comment:
we already protect by mutex, Is atomic operation still necessary?
if necessary we should use atomic_cmpxchg
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]