Skip to content
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

Merged
merged 1 commit into from Nov 17, 2014

Conversation

Dr15Jones
Copy link
Contributor

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.

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};
Copy link
Contributor Author

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.

@cmsbuild
Copy link
Contributor

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
PhysicsTools/MVAComputer

@apfeiffer1, @nclopezo, @cerminar, @monttj, @cmsbuild, @diguida, @rcastello, @ggovi, @vadler, @mmusich can you please review it and eventually sign? Thanks.
@ferencek, @acaudron, @pvmulder, @imarches this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@nclopezo you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@apfeiffer1
Copy link
Contributor

+1

@diguida
Copy link
Contributor

diguida commented Nov 14, 2014

+1

@Dr15Jones
Copy link
Contributor Author

@cmsbuild I think this was a transient error, please test again.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

@davidlange6
Copy link
Contributor

bypassing - no change seen and trivial

davidlange6 added a commit that referenced this pull request Nov 17, 2014
@davidlange6 davidlange6 merged commit 5be37e7 into cms-sw:CMSSW_7_3_X Nov 17, 2014
@vadler
Copy link

vadler commented Nov 17, 2014

+1

@Dr15Jones Dr15Jones deleted the removeUseOfBoostMutex branch January 23, 2015 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants