-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pthread: remove enter_critical_section in pthread_mutex #15126
base: master
Are you sure you want to change the base?
Conversation
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements. While it provides a reason for the change and identifies a related PR, it lacks crucial information. Here's what's missing:
Therefore, the PR needs substantial revision to meet the stated requirements before it can be properly reviewed. |
sched/pthread/pthread_mutex.c
Outdated
@@ -92,7 +98,7 @@ static void pthread_mutex_remove(FAR struct pthread_mutex_s *mutex) | |||
FAR struct pthread_mutex_s *prev; | |||
irqstate_t flags; | |||
|
|||
flags = enter_critical_section(); | |||
flags = spin_lock_irqsave(&g_mutex_spinlock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need lock? is mhead list only modified by one thread(rtcb)?
sched/pthread/pthread_mutex.c
Outdated
* Public Data | ||
****************************************************************************/ | ||
|
||
static spinlock_t g_mutex_spinlock = SP_UNLOCKED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to tcb_s? only need when CONFIG_PTHREAD_MUTEX_UNSAFE isn't true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reason: We would like to replace the critical section with a small lock. Signed-off-by: hujun5 <[email protected]>
Summary
pthread: remove enter_critical_section in pthread_mutex
reason:
We would like to replace the critical section with a small lock.
This PR requires #14578 to be merged first.
Impact
pthread
Testing
ci ostest