#include "glibmm/thread.h"
#include <list>
-
-
+
template<class T>
class RCUManager
{
}
- virtual boost::shared_ptr<T> write_copy ()
+ boost::shared_ptr<T> write_copy ()
{
m_lock.lock();
current_write_old = RCUManager<T>::m_rcu_value;
boost::shared_ptr<T> new_copy (new T(**current_write_old));
-
+
return new_copy;
}
- virtual bool update (boost::shared_ptr<T> new_value)
+ bool update (boost::shared_ptr<T> new_value)
{
// we hold the lock at this point effectively blocking
// other writers.
return ret;
}
+
+ void flush () {
+ Glib::Mutex::Lock lm (m_lock);
+ m_dead_wood.clear ();
+ }
private:
Glib::Mutex m_lock;