diff options
author | Robin Gareus <robin@gareus.org> | 2016-02-14 02:13:04 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-02-14 02:13:04 +0100 |
commit | 455f07d0878723e3dd9edc22475d95566b8d568f (patch) | |
tree | 4d9de65f0462eb451f5c5206703d46ea5929bcc3 /libs | |
parent | 794f4cd360a044830586b91b5f874211a589e16b (diff) |
fix rare livelock in std::map thread_buffer_requests
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.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/pbd/event_loop.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/pbd/event_loop.cc b/libs/pbd/event_loop.cc index 3f5eeb0a75..08f3c2e158 100644 --- a/libs/pbd/event_loop.cc +++ b/libs/pbd/event_loop.cc @@ -147,7 +147,7 @@ EventLoop::pre_register (const string& emitting_thread_name, uint32_t num_reques */ ThreadBufferMapping mapping; - Glib::Threads::RWLock::ReaderLock lm (thread_buffer_requests_lock); + Glib::Threads::RWLock::WriterLock lm (thread_buffer_requests_lock); for (RequestBufferSuppliers::iterator trs = request_buffer_suppliers.begin(); trs != request_buffer_suppliers.end(); ++trs) { |