fix making static locals thread safe#712
Draft
Vipul-Cariappa wants to merge 1 commit intocompiler-research:mainfrom
Draft
fix making static locals thread safe#712Vipul-Cariappa wants to merge 1 commit intocompiler-research:mainfrom
Vipul-Cariappa wants to merge 1 commit intocompiler-research:mainfrom
Conversation
having static locals can be risky and we might want to move them into the InterpreterInfo class
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #712 +/- ##
==========================================
+ Coverage 81.46% 81.49% +0.03%
==========================================
Files 9 9
Lines 4213 4221 +8
==========================================
+ Hits 3432 3440 +8
Misses 781 781
🚀 New features to boost your workflow:
|
| std::lock_guard<std::recursive_mutex> Lock(gWrapperStoreMutex); | ||
| auto R = gWrapperStore.find(FD); | ||
| if (R != gWrapperStore.end()) | ||
| return (JitCall::GenericCall)R->second; |
Contributor
There was a problem hiding this comment.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
return (JitCall::GenericCall)R->second;
^| std::lock_guard<std::recursive_mutex> Lock(gDtorWrapperStoreMutex); | ||
| auto I = gDtorWrapperStore.find(D); | ||
| if (I != gDtorWrapperStore.end()) | ||
| return (JitCall::DestructorCall)I->second; |
Contributor
There was a problem hiding this comment.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
return (JitCall::DestructorCall)I->second;
^
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Having static locals can be risky, and we might want to move them into the InterpreterInfo class.
Will open an issue on this; we can fix it later. I want to first make sure that this fixes the random crashes seen in our CI since the merge of thread-safety PR.
Fixes # (issue)
Hopfully this fixes the random failures that we are seeing in the CI.
Type of change
Please tick all options which are relevant.
TODOs for MySelf
parentandinterpas arguments. LikeCpp::GetNamed...