-
Notifications
You must be signed in to change notification settings - Fork 311
Fix data races found by ThreadSanitizer #7673
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
45e5207
9d440b6
96b1c71
cfe0340
c35e283
9e1e23c
f682e40
88cf2c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -137,23 +137,13 @@ M*/ | |
| #define MPIDUI_THREAD_CS_ENTER(mutex) \ | ||
| do { \ | ||
| if (MPIR_ThreadInfo.isThreaded) { \ | ||
| int equal_ = 0; \ | ||
| MPL_thread_id_t self_, owner_; \ | ||
| MPL_thread_self(&self_); \ | ||
| owner_ = mutex.owner; \ | ||
| MPL_thread_same(&self_, &owner_, &equal_); \ | ||
| if (!equal_) { \ | ||
| int err_ = 0; \ | ||
| MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_mutex_lock %p", &mutex); \ | ||
| MPIDU_Thread_mutex_lock(&mutex, &err_, MPL_THREAD_PRIO_HIGH);\ | ||
| MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_mutex_lock %p", &mutex); \ | ||
| MPIR_Assert(err_ == 0); \ | ||
| MPIR_Assert(mutex.count == 0); \ | ||
| MPL_thread_self(&mutex.owner); \ | ||
| } else { \ | ||
| /* assert all recursive usage */ \ | ||
| MPIR_Assert(0); \ | ||
| } \ | ||
| int err_ = 0; \ | ||
| MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_mutex_lock %p", &mutex); \ | ||
| MPIDU_Thread_mutex_lock(&mutex, &err_, MPL_THREAD_PRIO_HIGH); \ | ||
| MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_mutex_lock %p", &mutex); \ | ||
| MPIR_Assert(err_ == 0); \ | ||
| MPIR_Assert(mutex.count == 0); \ | ||
| MPL_thread_self(&mutex.owner); \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The commit message is inaccurate. It is removing the ownership check. The recursive lock check is still on. And the reason for that change is because we no longer support recursive locking and the owner checking is no longer needed. The race condition is a trigger for the removal, but not the reason. If it is the reason, we should fix it rather than removing it. |
||
| mutex.count++; \ | ||
| } \ | ||
| } while (0) | ||
|
|
||
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.
Grammar error in commit message.