Module: sems Branch: master Commit: afbad3b3107fbf7da48fab7fc064096520514a87 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=afbad3b3107fbf7da48fab7fc064096520514a87
Author: Stefan Sayer <[email protected]> Committer: Stefan Sayer <[email protected]> Date: Fri Jul 2 01:30:41 2010 +0200 function to test whether events are pending --- core/AmEventQueue.cpp | 7 +++++++ core/AmEventQueue.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/core/AmEventQueue.cpp b/core/AmEventQueue.cpp index c6ae9d8..6cbc490 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 e6322ea..37dbb9a 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); }; _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
