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
Replace use of boost::mutex #6411
Replace use of boost::mutex #6411
Conversation
Since the C++11 standard now has a full array of thread related classes we no longer need to use the boost equivalent. Switching to the appropriate std class should allow for easier maintenance.
@@ -129,10 +129,8 @@ std::string ProcExternal::getInstanceName() const | |||
|
|||
static MVAComputer::CacheId getNextMVAComputerCacheId() | |||
{ | |||
static boost::mutex mutex; | |||
static MVAComputer::CacheId nextCacheId = 0; | |||
static std::atomic<MVAComputer::CacheId> nextCacheId{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.
An atomic is much more performant.
A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_7_3_X. Replace use of boost::mutex It involves the following packages: CondFormats/PhysicsToolsObjects @apfeiffer1, @nclopezo, @cerminar, @monttj, @cmsbuild, @diguida, @rcastello, @ggovi, @vadler, @mmusich can you please review it and eventually sign? Thanks. |
+1 |
+1 |
@cmsbuild I think this was a transient error, please test again. |
bypassing - no change seen and trivial |
Replace use of boost::mutex
+1 |
Since the C++11 standard now has a full array of thread related classes
we no longer need to use the boost equivalent. Switching to the appropriate
std class should allow for easier maintenance.
The static analyzer was complaining about boost::mutex since the analyzer doesn't know it is thread safe. Rather than modify the analyzer I believe it is better to switch to the appropriate C++11 class.