Commit 8d41a6b5 authored by schurade's avatar schurade
Browse files

[CHANGE] added exclusive access to the setValue function

parent 4b539a5b
......@@ -32,6 +32,7 @@
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/locks.hpp>
#include <boost/thread.hpp>
#include "WProperty.h"
......@@ -78,10 +79,15 @@ public:
template < typename T > void setValue( std::string prop, const T& arg )
{
boost::shared_lock<boost::shared_mutex> slock;
slock = boost::shared_lock<boost::shared_mutex>( m_updateLock );
if ( findProp( prop ) )
{
findProp( prop )->setValue( arg );
}
slock.unlock();
}
template < typename T > void setMin( std::string prop, const T& arg )
......@@ -134,6 +140,8 @@ private:
std::map < std::string, WProperty* >m_propertyList;
std::vector< WProperty* >m_propertyVector;
boost::shared_mutex m_updateLock;
};
#endif // WPROPERTIES_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment