You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "pkarashchenko (via GitHub)" <gi...@apache.org> on 2023/09/18 08:02:45 UTC
[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #10681: pthread_once: use [enter|leave]_critical_section replace sched_[un]lock
pkarashchenko commented on code in PR #10681:
URL: https://github.com/apache/nuttx/pull/10681#discussion_r1328367946
##########
libs/libc/pthread/pthread_once.c:
##########
@@ -73,15 +75,15 @@ int pthread_once(FAR pthread_once_t *once_control,
/* Prohibit pre-emption while we test and set the once_control. */
- sched_lock();
+ flags = enter_critical_section();
Review Comment:
The only one question here: is critical section enough or we need to use spinlock? I mean on theory can we have a situation when `once_control` may be modified from different cores?
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org