Update call_slot() API, inform caller if slot cannot be queued

It can happen that ::get_request() returns NULL if the
EventPool is full. In that case the slot is never called.

In this case the caller can now take action.
This commit is contained in:
Robin Gareus 2022-06-09 01:46:27 +02:00
parent 03e0fe0a73
commit 95aa39d1c4
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
5 changed files with 15 additions and 9 deletions

View file

@ -109,7 +109,7 @@ public:
run_loop_thread = Glib::Threads::Thread::self ();
}
void call_slot (InvalidationRecord* ir, const boost::function<void()>& f)
bool call_slot (InvalidationRecord* ir, const boost::function<void()>& f)
{
if (Glib::Threads::Thread::self () == run_loop_thread) {
cout << string_compose ("%1/%2 direct dispatch of call slot via functor @ %3, invalidation %4\n", event_loop_name (), pthread_name (), &f, ir);
@ -119,6 +119,7 @@ public:
assert (!ir);
f (); // XXX TODO, queue and process during run ()
}
return true;
}
void run ()