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

Declare more framework non-const statics const or atomic #1296

Merged
merged 2 commits into from Nov 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions FWCore/Framework/interface/ComponentFactory.h
Expand Up @@ -111,7 +111,7 @@ template<typename T>
}

// ---------- static member functions --------------------
static ComponentFactory<T>* get();
static ComponentFactory<T> const* get();

// ---------- member functions ---------------------------

Expand All @@ -129,9 +129,9 @@ template<typename T>
}
#define COMPONENTFACTORY_GET(_type_) \
EDM_REGISTER_PLUGINFACTORY(edmplugin::PluginFactory<edm::eventsetup::ComponentMakerBase<_type_>* ()>,_type_::name()); \
static edm::eventsetup::ComponentFactory<_type_> s_dummyfactory; \
static edm::eventsetup::ComponentFactory<_type_> const s_dummyfactory; \
namespace edm { namespace eventsetup { \
template<> edm::eventsetup::ComponentFactory<_type_>* edm::eventsetup::ComponentFactory<_type_>::get() \
template<> edm::eventsetup::ComponentFactory<_type_> const* edm::eventsetup::ComponentFactory<_type_>::get() \
{ return &s_dummyfactory; } \
} } \
typedef int componentfactory_get_needs_semicolon
Expand Down
2 changes: 0 additions & 2 deletions FWCore/PluginManager/interface/ProblemTracker.h
Expand Up @@ -24,8 +24,6 @@ namespace edm
ProblemTracker();
~ProblemTracker();
ProblemTracker(const ProblemTracker&);

static bool dead_;
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable should just be removed. It is set in three places but never read.

class AssertHandler
Expand Down
3 changes: 0 additions & 3 deletions FWCore/PluginManager/src/ProblemTracker.cc
Expand Up @@ -11,12 +11,10 @@ namespace edm

// -----------------------------------------------

bool ProblemTracker::dead_ = true;
//edmplugin::DebugAids::AssertHook ProblemTracker::old_assert_hook_ = 0;

ProblemTracker::ProblemTracker()
{
dead_ = false;
//old_assert_hook_ = edmplugin::DebugAids::failHook(&failure);
if(not edmplugin::PluginManager::isAvailable()) {
edmplugin::PluginManager::Config config(edmplugin::standard::config());
Expand All @@ -28,7 +26,6 @@ namespace edm
ProblemTracker::~ProblemTracker()
{
// since this is a singleton, we will not restore the old handle
dead_ = true;
}

ProblemTracker const* ProblemTracker::instance()
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Services/src/VertexTracker.cc
Expand Up @@ -2,7 +2,7 @@

#include <ostream>

unsigned int VertexTracker::next_id_ = 0;
std::atomic<unsigned int> VertexTracker::next_id_{0};

std::ostream&
operator<<(std::ostream& ost, const VertexTracker& vt)
Expand Down
3 changes: 2 additions & 1 deletion FWCore/Services/src/VertexTracker.h
@@ -1,6 +1,7 @@
#ifndef FWCore_Services_Vertex_Tracker_h
#define FWCore_Services_Vertex_Tracker_h

#include <atomic>
#include <iosfwd>
#include <string>

Expand Down Expand Up @@ -99,7 +100,7 @@ struct VertexTracker
mutable float percent_leaf_;
mutable float percent_path_;

static unsigned int next_id_;
static std::atomic<unsigned int> next_id_;
};

std::ostream&
Expand Down