diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/Buffer.hpp | 15 | ||||
-rw-r--r-- | src/server/ProcessSlave.hpp | 3 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp index e44915b3..45afa6aa 100644 --- a/src/server/Buffer.hpp +++ b/src/server/Buffer.hpp @@ -18,13 +18,17 @@ #ifndef INGEN_ENGINE_BUFFER_HPP #define INGEN_ENGINE_BUFFER_HPP -#include <cstddef> #include <cassert> -#include <boost/utility.hpp> +#include <cstddef> + #include <boost/intrusive_ptr.hpp> +#include <boost/utility.hpp> + +#include "ingen/PortType.hpp" +#include "raul/AtomicInt.hpp" #include "raul/Deletable.hpp" #include "raul/SharedPtr.hpp" -#include "ingen/PortType.hpp" + #include "types.hpp" #include "BufferFactory.hpp" @@ -68,7 +72,6 @@ public: inline void ref() { ++_refs; } inline void deref() { - assert(_refs > 0); if ((--_refs) == 0) _factory.recycle(this); } @@ -82,8 +85,8 @@ protected: virtual ~Buffer() {} private: - Buffer* _next; ///< Intrusive linked list for BufferFactory - size_t _refs; ///< Intrusive reference count for intrusive_ptr + Buffer* _next; ///< Intrusive linked list for BufferFactory + Raul::AtomicInt _refs; ///< Intrusive reference count for intrusive_ptr }; } // namespace Server diff --git a/src/server/ProcessSlave.hpp b/src/server/ProcessSlave.hpp index 4fb4b9d5..620c58e9 100644 --- a/src/server/ProcessSlave.hpp +++ b/src/server/ProcessSlave.hpp @@ -27,6 +27,7 @@ #include "Driver.hpp" #include "Engine.hpp" #include "ProcessContext.hpp" +#include "ThreadManager.hpp" namespace Ingen { namespace Server { @@ -53,6 +54,8 @@ public: if (realtime) set_scheduling(SCHED_FIFO, 40); + + set_context(THREAD_PROCESS); } ~ProcessSlave() { |