diff options
author | Robin Gareus <robin@gareus.org> | 2016-12-13 23:46:55 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-12-13 23:47:07 +0100 |
commit | fa07233a17036bc1cab69d5854b5c768ff762f5b (patch) | |
tree | 4048a4a6ca22845a9c80b0ecaf94a453b08b88da /libs/pbd/event_loop.cc | |
parent | 176625d9e0dbe53c9f5628d172ee6f5488be8202 (diff) |
mutex 'er up
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.
Diffstat (limited to 'libs/pbd/event_loop.cc')
-rw-r--r-- | libs/pbd/event_loop.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/pbd/event_loop.cc b/libs/pbd/event_loop.cc index ea3f7a46af..fbbf9c83aa 100644 --- a/libs/pbd/event_loop.cc +++ b/libs/pbd/event_loop.cc @@ -60,7 +60,7 @@ EventLoop::set_event_loop_for_thread (EventLoop* loop) void* EventLoop::invalidate_request (void* data) { - InvalidationRecord* ir = (InvalidationRecord*) data; + InvalidationRecord* ir = (InvalidationRecord*) data; /* Some of the requests queued with an EventLoop may involve functors * that make method calls to objects whose lifetime is shorter @@ -88,6 +88,7 @@ EventLoop::invalidate_request (void* data) if (ir->event_loop) { Glib::Threads::Mutex::Lock lm (ir->event_loop->slot_invalidation_mutex()); + Glib::Threads::Mutex::Lock lr (ir->event_loop->request_invalidation_mutex()); for (list<BaseRequestObject*>::iterator i = ir->requests.begin(); i != ir->requests.end(); ++i) { (*i)->valid = false; (*i)->invalidation = 0; |