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

@ -96,10 +96,11 @@ class MyEventLoop : public sigc::trackable, public EventLoop
run_loop_thread = Glib::Threads::Thread::self();
}
void call_slot (InvalidationRecord*, const boost::function<void()>& f) {
bool call_slot (InvalidationRecord*, const boost::function<void()>& f) {
if (Glib::Threads::Thread::self() == run_loop_thread) {
f ();
}
return true;
}
Glib::Threads::Mutex& slot_invalidation_mutex() { return request_buffer_map_lock; }