summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltimer.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-02-04 11:08:49 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-02-04 11:08:49 +0000
commit14d942f16b284ca5180b29f3c912d158c0d0cdd0 (patch)
treeef23529c6d4ec51fa1f76d66f57716eb96ca2f7a /indra/llcommon/lltimer.cpp
parentf700be39e7dc9b9e6e56031818b94c329383a097 (diff)
A flag+assert to help track bad behaviour in LLEventTimer, especially EXT-4754
Diffstat (limited to 'indra/llcommon/lltimer.cpp')
-rw-r--r--indra/llcommon/lltimer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp
index ef3e8dbc94..63634117b5 100644
--- a/indra/llcommon/lltimer.cpp
+++ b/indra/llcommon/lltimer.cpp
@@ -565,19 +565,23 @@ LLEventTimer::LLEventTimer(F32 period)
: mEventTimer()
{
mPeriod = period;
+ mBusy = false;
}
LLEventTimer::LLEventTimer(const LLDate& time)
: mEventTimer()
{
mPeriod = (F32)(time.secondsSinceEpoch() - LLDate::now().secondsSinceEpoch());
+ mBusy = false;
}
LLEventTimer::~LLEventTimer()
{
+ llassert(!mBusy); // this LLEventTimer was destroyed from its own tick() function - bad.
}
+//static
void LLEventTimer::updateClass()
{
std::list<LLEventTimer*> completed_timers;
@@ -587,10 +591,12 @@ void LLEventTimer::updateClass()
F32 et = timer.mEventTimer.getElapsedTimeF32();
if (timer.mEventTimer.getStarted() && et > timer.mPeriod) {
timer.mEventTimer.reset();
+ timer.mBusy = true;
if ( timer.tick() )
{
completed_timers.push_back( &timer );
}
+ timer.mBusy = false;
}
}