summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/session_event.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-12-04 19:24:09 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-12-04 19:24:09 +0000
commit4a3d7877f6b03fac7755f997b945583ba5732d13 (patch)
tree1099df5854224acbb17a650215d7f07710b8babe /libs/ardour/ardour/session_event.h
parent478fd92039443743babec98812f10921209f1e5a (diff)
cross-thread handling of SessionEvent allocation/deallocation, with widespread consequences
git-svn-id: svn://localhost/ardour2/branches/3.0@6283 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/session_event.h')
-rw-r--r--libs/ardour/ardour/session_event.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h
index 767c374988..07c795257f 100644
--- a/libs/ardour/ardour/session_event.h
+++ b/libs/ardour/ardour/session_event.h
@@ -98,18 +98,17 @@ struct SessionEvent {
return e1->before (*e2);
}
- void *operator new (size_t) {
- return pool.alloc ();
- }
-
- void operator delete (void *ptr, size_t /*size*/) {
- pool.release (ptr);
- }
+ void* operator new (size_t);
+ void operator delete (void *ptr, size_t /*size*/);
static const nframes_t Immediate = 0;
+ static void create_per_thread_pool (const std::string& n, unsigned long nitems);
+ static void init_event_pool ();
+
private:
- static MultiAllocSingleReleasePool pool;
+ static PerThreadPool* pool;
+ CrossThreadPool* own_pool;
};
class SessionEventManager {
@@ -120,8 +119,8 @@ class SessionEventManager {
void add_event (nframes64_t action_frame, SessionEvent::Type type, nframes64_t target_frame = 0);
void remove_event (nframes64_t frame, SessionEvent::Type type);
void clear_events (SessionEvent::Type type);
-
-
+
+
protected:
RingBuffer<SessionEvent*> pending_events;
typedef std::list<SessionEvent *> Events;