Skip to content
Snippets Groups Projects
Commit 5440f892 authored by Jeremie Deray's avatar Jeremie Deray
Browse files

NodeBase & CaptureBase *id_count atomic_uint

parent 63e79c14
No related branches found
No related tags found
1 merge request!90[WIP] ProcessorBase multi-threading
This commit is part of merge request !90. Comments created here will be created in the context of that merge request.
......@@ -3,7 +3,7 @@
namespace wolf{
unsigned int CaptureBase::capture_id_count_ = 0;
std::atomic_uint CaptureBase::capture_id_count_(0);
CaptureBase::CaptureBase(const std::string& _type, const TimeStamp& _ts, SensorBasePtr _sensor_ptr) :
NodeBase("CAPTURE", _type),
......
......@@ -23,7 +23,7 @@ class CaptureBase : public NodeBase, public std::enable_shared_from_this<Capture
FrameBaseWPtr frame_ptr_;
FeatureBaseList feature_list_;
static unsigned int capture_id_count_;
static std::atomic_uint capture_id_count_;
protected:
unsigned int capture_id_;
......
......@@ -3,6 +3,6 @@
namespace wolf {
//init static node counter
unsigned int NodeBase::node_id_count_ = 0;
std::atomic_uint NodeBase::node_id_count_(0);
} // namespace wolf
......@@ -4,6 +4,8 @@
// Wolf includes
#include "wolf.h"
// std includes
#include <atomic>
namespace wolf {
......@@ -54,7 +56,7 @@ namespace wolf {
class NodeBase
{
private:
static unsigned int node_id_count_; ///< Object counter (acts as simple ID factory)
static std::atomic_uint node_id_count_; ///< Object counter (acts as simple ID factory)
protected:
ProblemWPtr problem_ptr_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment