mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-14 10:36:34 +01:00
Mitigate "POOL OUT OF MEMORY" when batch changing controllables
This commit is contained in:
parent
b1b57571e7
commit
01b06906b0
1 changed files with 25 additions and 0 deletions
|
|
@ -46,6 +46,31 @@ Session::set_controls (boost::shared_ptr<ControlList> cl, double val, Controllab
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
/* This is called by the GUI thread, so we can wait if neccessary to prevent
|
||||||
|
* "POOL OUT OF MEMORY" fatal errors.
|
||||||
|
*
|
||||||
|
* This is not a good solution, because if this happens
|
||||||
|
* event_loop->call_slot() will most likely also fail to queue a request
|
||||||
|
* to delete the Events. There is likely an additional Changed() signal
|
||||||
|
* which needds a EventLoop RequestBuffer slot.
|
||||||
|
*
|
||||||
|
* Ideally the EventLoop RequestBuffer would be at least twice the size
|
||||||
|
* of the the SessionEvent Pool, but it isn't, and even then there may
|
||||||
|
* still be other signals scheduling events...
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
if (SessionEvent::pool_available () < 8) {
|
||||||
|
int sleeptm = std::max (40000, engine().usecs_per_cycle ());
|
||||||
|
int timeout = std::max (10, 1000000 / sleeptm);
|
||||||
|
do {
|
||||||
|
usleep (sleeptm);
|
||||||
|
ARDOUR::GUIIdle ();
|
||||||
|
}
|
||||||
|
while (SessionEvent::pool_available () < 8 && --timeout > 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (ControlList::iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
for (ControlList::iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||||
/* as of july 2017 this is a no-op for everything except record enable */
|
/* as of july 2017 this is a no-op for everything except record enable */
|
||||||
(*ci)->pre_realtime_queue_stuff (val, gcd);
|
(*ci)->pre_realtime_queue_stuff (val, gcd);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue