diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-11-15 22:33:00 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-11-15 22:33:00 +0000 |
| commit | 9f34bd86d0dc2c2ea51fe9aa54533aa68cfadc64 (patch) | |
| tree | 7e897677a0689f97e09f0ac393fbe2152ebc452e /lib/base/ebase.cpp | |
| parent | 9aa7c938a1f03c1e42ed370c4895e549e7a6d80d (diff) | |
| download | enigma2-9f34bd86d0dc2c2ea51fe9aa54533aa68cfadc64.tar.gz enigma2-9f34bd86d0dc2c2ea51fe9aa54533aa68cfadc64.zip | |
improve locking of addTimeOffset a bit
Diffstat (limited to 'lib/base/ebase.cpp')
| -rw-r--r-- | lib/base/ebase.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/base/ebase.cpp b/lib/base/ebase.cpp index 7300a571..7951f6e7 100644 --- a/lib/base/ebase.cpp +++ b/lib/base/ebase.cpp @@ -165,6 +165,7 @@ void eMainloop::processOneEvent() if (m_timer_list) { + singleLock s(recalcLock); poll_timeout = timeval_to_usec(m_timer_list.begin()->getNextActivation() - now); /* if current timer already passed, don't delay infinite. */ if (poll_timeout < 0) @@ -225,6 +226,8 @@ void eMainloop::processOneEvent() /* when we not processed anything, check timers. */ if (!ret) { + singleLock s(recalcLock); + /* process all timers which are ready. first remove them out of the list. */ while ((!m_timer_list.empty()) && (m_timer_list.begin()->getNextActivation() < now)) m_timer_list.begin()->activate(); @@ -287,9 +290,13 @@ void eMainloop::quit( int ret ) // call this to leave all loops void eMainloop::addTimeOffset(int offset) { - singleLock s(recalcLock); - for (ePtrList<eTimer>::iterator it = m_timer_list.begin(); it != m_timer_list.end(); ++it ) - it->addTimeOffset(offset); + for (ePtrList<eMainloop>::iterator it(eMainloop::existing_loops) + ;it != eMainloop::existing_loops.end(); ++it) + { + singleLock s(it->recalcLock); + for (ePtrList<eTimer>::iterator tit = it->m_timer_list.begin(); tit != it->m_timer_list.end(); ++tit ) + tit->addTimeOffset(offset); + } } eApplication* eApp = 0; |
