-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tentative fix for initializer list thread race condition
Tentative fix for this Duo report [here](https://2dimensions.slack.com/archives/C029X99PETE/p1692977259716259) Make sure we initialize & start the thread so every other field is already initialized. [Source](https://en.cppreference.com/w/cpp/language/constructor) ``` Initialization order The order of member initializers in the list is irrelevant: the actual order of initialization is as follows: 1) If the constructor is for the most-derived class, virtual bases are initialized in the order in which they appear in depth-first left-to-right traversal of the base class declarations (left-to-right refers to the appearance in base-specifier lists). 2) Then, direct bases are initialized in left-to-right order as they appear in this class's base-specifier list. 3) Then, non-static data member are initialized in order of declaration in the class definition. 4) Finally, the body of the constructor is executed. ``` Also, a sort-of repro [here](https://alexanderhoughton.co.uk/blog/stdmutex-crash-on-initial-lock-interesting-thread-releated-bug-with-fix-included/) Diffs= 4ff3d9cee Tentative fix for initializer list thread race condition (#5920) Co-authored-by: Umberto Sonnino <[email protected]>
- Loading branch information
1 parent
01f752a
commit 850bc8b
Showing
4 changed files
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
d35df04272e659d8244c776e9c4f558452888501 | ||
4ff3d9cee0a9a9acd7874ab6782015f7c11a661e |
This file contains 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
This file contains 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
This file contains 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