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
Made CSCIndexer const thread-safe #38458
Conversation
Converted delayed creation of fixed value std::vector to be a const static function local.
please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38458/30669
|
A new Pull Request was created by @Dr15Jones (Chris Jones) for master. It involves the following packages:
@civanch, @mdhildreth can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82dc3e/25676/summary.html Comparison SummarySummary:
|
@Dr15Jones , is it really thread safe static const auto s_chamberLabel = fillChamberLabel(); I never tried such construction, no locks is needed here? |
@civanch the C++ language guarantees that function local statics are initialized once and only once by the first thread that encounters them. If a second thread arrives at the same time as the initialization is happening, the C++ language guarantees that the later threads will wait until the initialization is finished. |
+1 Thanks @Dr15Jones ! |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
Converted delayed creation of fixed value std::vector to be a const static function local.
This problem was identified by the static analyzer.
PR validation:
Code compiles.