summaryrefslogtreecommitdiff
path: root/libs/pbd/event_loop.cc
AgeCommit message (Collapse)Author
2017-01-20Reap invalidation recordsRobin Gareus
2016-12-15rework request invalidationRobin Gareus
This kills 2 birds with 1 stone: Removes the necessity of locks and makes call_slot() realtime safe (req->invalidation->requests list push_back). On object destruction, the invalidation-record (IR) itself is invalidated. Invalidated IRs are pushed onto a trash-pool and deleted in the event-loop of the invalidated object (GUI thread) once all requests that reference it have been processed. One last detail remains: PBD::signal connect should reference the IR and disconnect unreference it. This will guarantee that signal emission will not reference the IR while the pool trash is dropped.
2016-12-14Add a trash pool for invalidation requests.Robin Gareus
While EventLoop::invalidate_request() does invalidate request in the request-list. It does *not* invalidate requests in the per-thread-request-ringbuffer(s). The invalidation record cannot be deleted in EventLoop::invalidate_request see 6b5891a78f.
2016-12-14Atomically to invalidate requestRobin Gareus
Yet another slightly overkill approach, but it /may/ explain crashes.
2016-12-14Add some more invalidation debug messages.Robin Gareus
2016-12-14rework locking (fa07233a, 112fba182)Robin Gareus
For now: use a single lock, which should fix all related crashes. optimize (with less contended partial locks) if this works.
2016-12-14release locks before deleting recordRobin Gareus
2016-12-13mutex 'er upRobin Gareus
Some overzealous locking to track down RequestObject related crashes. bc0fa4d689a4 wrongly locked the current event loop's request_invalidation_lock instead of the invalidation's list lock. Also Abstract UI is able to delete requests concurrently with with EventLoop invalidation. e.g. PortManager::PortRegisteredOrUnregistered and GlobalPortMatrixWindow so the lock needs to be exposed. If this solves various issues, mutexes should to be consolidated (request_buffer_map_lock + request_invalidation_lock) and be chosen such that there is as little contention as possible.
2016-07-14enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.hPaul Davis
2016-02-14fix rare livelock in std::map thread_buffer_requestsRobin Gareus
During initial session load it's possible that two threads call PBD::notify_event_loops_about_thread_creation() simultaneously (in particular the process threads). This can lead to an endless loop in stl_tree.h when assigning thread_buffer_requests[key] Now we only have WriteLocks.. unless some better solution comes up a Mutex will do.
2016-01-14use correct type of lock when removing a thread request bufferPaul Davis
2016-01-14fully clean up request buffers when a thread diesPaul Davis
2016-01-14manually revert 4b3043cc and 141e6fb8181; add detailed explanatory commentPaul Davis
2016-01-13use a unique key to store per-thread request buffersPaul Davis
2016-01-13yet more event loop debug tracingPaul Davis
2015-12-28redesign cross-thread registration/signalling systemPaul Davis
This new design will work even when threads that need to receive messages from RT threads are created *after* the RT threads. The existing design would fail because the RT thread(s) would never be known the later created threads, and so signals emitted by the RT thread and causing call_slot() in the receiver would end up being enqueued using a lock-protected list. The new design ensures that communication always uses a lock-free FIFO instead
2015-12-12move BaseUI::_name into EventLoop; rename access method in EventLoop as ↵Paul Davis
event_loop_name() to clarify usage
2015-10-05NOOP, remove trailing tabs/whitespace.Robin Gareus
2015-10-04globally remove all trailing whitespace from ardour code base.Paul Davis
Paul Davis was responsible for introducing almost all of this.
2013-01-16add copyright commentsPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@13857 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-07-25convert from Glib:: to Glib::Threads for all thread-related APIPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@13084 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-06-23Remove unnecessary header includesTim Mayberry
git-svn-id: svn://localhost/ardour2/branches/3.0@12827 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-24eventloop and abstractui debugging, lots more commenting on ↵Paul Davis
abstractui/eventloop implementation; minor tweaks elsewhere git-svn-id: svn://localhost/ardour2/branches/3.0@12076 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-04-19allow invalidation-of-UI-request-by-object-deletion to work more often by ↵Paul Davis
setting the event loop record at connect time, not execution time git-svn-id: svn://localhost/ardour2/branches/3.0@9379 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-29Fix build.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8376 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-29Remove debug code.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8374 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-04-03Allow cross-thread request invalidators to cope with multiple requestsCarl Hetherington
being logged before they are handled, and to invalidate them all rather than just the last one. Fixes shutdown problems when the PortMatrix has been opened during the session, during which PortRegisteredOrUnregistered is emitted quite heavily. git-svn-id: svn://localhost/ardour2/branches/3.0@6852 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-04-02Couple of comments.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@6851 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-03-30handle deletion of UI objects between the time that a callback is queued ↵Paul Davis
with the UI event loop and the execution of the callback (intrusive, big) git-svn-id: svn://localhost/ardour2/branches/3.0@6807 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-21fully implement and deploy explicit x-thread signal connection syntax ↵Paul Davis
(testing comes next) git-svn-id: svn://localhost/ardour2/branches/3.0@6379 d708f5d6-7413-0410-9779-e7cbd77b26cf