TT#52455 sems-* constant 10% CPU usage in idle Virtual environment vagrant/vmware

- DBRegagent loop sleep replaced with waitForEvent() call

Change-Id: I525b635442a16a00aca0e3fa5444b02393d9b1fe
changes/26/27126/1
Roman Romanchenko 7 years ago
parent 28bc88273c
commit d7bce5145b

@ -1,3 +1,4 @@
sipwise/tt52455.patch
upstream/0000-b-f-sbc-fixed-reading-encoding-param-in-readPayload.patch
upstream/0001-b-f-sbc-codecs-compare-encoding_param-only-if-both-0.patch
upstream/0002-core-codec-init-support-for-fmt-params-negotiation-f.patch

@ -0,0 +1,37 @@
--- a/apps/db_reg_agent/DBRegAgent.cpp
+++ b/apps/db_reg_agent/DBRegAgent.cpp
@@ -897,9 +897,8 @@ void DBRegAgent::run() {
DBG("running DBRegAgent thread...\n");
shutdown_finished = false;
while (running) {
+ waitForEventTimed(500); // 500 milliseconds
processEvents();
-
- usleep(1000); // 1ms
}
DBG("DBRegAgent done, removing all registrations from Event Dispatcher...\n");
--- a/core/AmEventQueue.cpp
+++ b/core/AmEventQueue.cpp
@@ -100,6 +100,11 @@ void AmEventQueue::waitForEvent()
ev_pending.wait_for();
}
+void AmEventQueue::waitForEventTimed(unsigned long msec)
+{
+ ev_pending.wait_for_to(msec);
+}
+
void AmEventQueue::processSingleEvent()
{
m_queue.lock();
--- a/core/AmEventQueue.h
+++ b/core/AmEventQueue.h
@@ -80,6 +80,7 @@ public:
void postEvent(AmEvent*);
void processEvents();
void waitForEvent();
+ void waitForEventTimed(unsigned long msec);
void processSingleEvent();
bool eventPending();
Loading…
Cancel
Save