diff options
author | David Robillard <d@drobilla.net> | 2006-08-24 07:37:17 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-08-24 07:37:17 +0000 |
commit | 25d1670a61d19e795227b939a98be9cf5a050c67 (patch) | |
tree | f288677bdbc2a2ff85763e59e5a9f801ca8f8489 /libs/pbd/pbd/rcu.h | |
parent | ea71de278461b2bc0240515b82bb56ef68f5eee3 (diff) |
Merged with trunk R846
Removed some overly verbose debug printing
git-svn-id: svn://localhost/ardour2/branches/midi@847 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd/rcu.h')
-rw-r--r-- | libs/pbd/pbd/rcu.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libs/pbd/pbd/rcu.h b/libs/pbd/pbd/rcu.h index 58a92a206a..e81db8ba87 100644 --- a/libs/pbd/pbd/rcu.h +++ b/libs/pbd/pbd/rcu.h @@ -5,8 +5,7 @@ #include "glibmm/thread.h" #include <list> - - + template<class T> class RCUManager { @@ -43,7 +42,7 @@ public: } - virtual boost::shared_ptr<T> write_copy () + boost::shared_ptr<T> write_copy () { m_lock.lock(); @@ -64,11 +63,11 @@ public: 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. @@ -98,6 +97,11 @@ public: return ret; } + + void flush () { + Glib::Mutex::Lock lm (m_lock); + m_dead_wood.clear (); + } private: Glib::Mutex m_lock; |