abstractui: provide a message if an event loop wakes but finds no work
(this only occurs for debug builds)
This commit is contained in:
parent
6e65e9c82f
commit
4a2c27ed6d
|
@ -217,6 +217,7 @@ AbstractUI<RequestObject>::handle_ui_requests ()
|
||||||
{
|
{
|
||||||
RequestBufferMapIterator i;
|
RequestBufferMapIterator i;
|
||||||
RequestBufferVector vec;
|
RequestBufferVector vec;
|
||||||
|
int cnt = 0;
|
||||||
|
|
||||||
/* check all registered per-thread buffers first */
|
/* check all registered per-thread buffers first */
|
||||||
Glib::Threads::RWLock::ReaderLock rbml (request_buffer_map_lock);
|
Glib::Threads::RWLock::ReaderLock rbml (request_buffer_map_lock);
|
||||||
|
@ -241,6 +242,8 @@ AbstractUI<RequestObject>::handle_ui_requests ()
|
||||||
if (trash.size() > 0) {
|
if (trash.size() > 0) {
|
||||||
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1 items in trash: %2\n", event_loop_name(), trash.size()));
|
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1 items in trash: %2\n", event_loop_name(), trash.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool buf_found = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1 check %2 request buffers for requests\n", event_loop_name(), request_buffers.size()));
|
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1 check %2 request buffers for requests\n", event_loop_name(), request_buffers.size()));
|
||||||
|
@ -267,6 +270,9 @@ AbstractUI<RequestObject>::handle_ui_requests ()
|
||||||
if (vec.len[0] == 0) {
|
if (vec.len[0] == 0) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef NDEBUG
|
||||||
|
buf_found = true;
|
||||||
|
#endif
|
||||||
if (vec.buf[0]->invalidation && !vec.buf[0]->invalidation->valid ()) {
|
if (vec.buf[0]->invalidation && !vec.buf[0]->invalidation->valid ()) {
|
||||||
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1: skipping invalidated request\n", event_loop_name()));
|
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1: skipping invalidated request\n", event_loop_name()));
|
||||||
rbml.release ();
|
rbml.release ();
|
||||||
|
@ -277,6 +283,7 @@ AbstractUI<RequestObject>::handle_ui_requests ()
|
||||||
|
|
||||||
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1: valid request, calling ::do_request()\n", event_loop_name()));
|
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1: valid request, calling ::do_request()\n", event_loop_name()));
|
||||||
do_request (vec.buf[0]);
|
do_request (vec.buf[0]);
|
||||||
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if the request was CallSlot, then we need to ensure that we reset the functor in the request, in case it
|
/* if the request was CallSlot, then we need to ensure that we reset the functor in the request, in case it
|
||||||
|
@ -301,6 +308,12 @@ AbstractUI<RequestObject>::handle_ui_requests ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
if (!buf_found) {
|
||||||
|
std::cerr << event_loop_name() << " woken, but not request buffers have any requests " << std::endl;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
assert (rbml.locked ());
|
assert (rbml.locked ());
|
||||||
for (i = request_buffers.begin(); i != request_buffers.end(); ) {
|
for (i = request_buffers.begin(); i != request_buffers.end(); ) {
|
||||||
if ((*i).second->dead) {
|
if ((*i).second->dead) {
|
||||||
|
@ -370,6 +383,7 @@ AbstractUI<RequestObject>::handle_ui_requests ()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
do_request (req);
|
do_request (req);
|
||||||
|
cnt++;
|
||||||
|
|
||||||
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2 delete heap request type %3\n", event_loop_name(), pthread_name(), req->type));
|
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2 delete heap request type %3\n", event_loop_name(), pthread_name(), req->type));
|
||||||
delete req;
|
delete req;
|
||||||
|
|
Loading…
Reference in New Issue