diff --git a/core/AmEventQueue.cpp b/core/AmEventQueue.cpp index c6ae9d83..6cbc4903 100644 --- a/core/AmEventQueue.cpp +++ b/core/AmEventQueue.cpp @@ -124,6 +124,13 @@ void AmEventQueue::processSingleEvent() m_queue.unlock(); } +bool AmEventQueue::eventPending() { + m_queue.lock(); + bool res = !ev_queue.empty(); + m_queue.unlock(); + return res; +} + void AmEventQueue::setEventNotificationSink(AmEventNotificationSink* _wakeup_handler) { // locking actually not necessary - if replacing pointer is atomic diff --git a/core/AmEventQueue.h b/core/AmEventQueue.h index e6322ea2..37dbb9ae 100644 --- a/core/AmEventQueue.h +++ b/core/AmEventQueue.h @@ -76,6 +76,7 @@ public: void waitForEvent(); void wakeup(); void processSingleEvent(); + bool eventPending(); void setEventNotificationSink(AmEventNotificationSink* _wakeup_handler); };