#define __pbd_rcu_h__
#include "boost/shared_ptr.hpp"
-#include "glibmm/thread.h"
+#include "glibmm/threads.h"
#include <list>
+#include "pbd/libpbd_visibility.h"
+
/** @file Defines a set of classes to implement Read-Copy-Update. We do not attempt to define RCU here - use google.
The design consists of two parts: an RCUManager and an RCUWriter.
and managed object.
*/
template<class T>
-class RCUManager
+class /*LIBPBD_API*/ RCUManager
{
public:
virtual ~RCUManager() { delete x.m_rcu_value; }
- boost::shared_ptr<T> reader () const { return *((boost::shared_ptr<T> *) g_atomic_pointer_get (&x.gptr)); }
+ boost::shared_ptr<T> reader () const { return *((boost::shared_ptr<T> *) g_atomic_pointer_get (&x.gptr)); }
/* this is an abstract base class - how these are implemented depends on the assumptions
that one can make about the users of the RCUManager. See SerializedRCUManager below
means that no actual objects will be deleted incorrectly if this is misused.
*/
template<class T>
-class SerializedRCUManager : public RCUManager<T>
+class /*LIBPBD_API*/ SerializedRCUManager : public RCUManager<T>
{
public:
}
void flush () {
- Glib::Mutex::Lock lm (m_lock);
+ Glib::Threads::Mutex::Lock lm (m_lock);
m_dead_wood.clear ();
}
private:
- Glib::Mutex m_lock;
+ Glib::Threads::Mutex m_lock;
boost::shared_ptr<T>* current_write_old;
std::list<boost::shared_ptr<T> > m_dead_wood;
};
*/
template<class T>
-class RCUWriter
+class /*LIBPBD_API*/ RCUWriter
{
public: