diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-02-04 14:43:29 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-02-04 14:43:29 -0500 |
commit | a93eb24e39458576475482b50ee0016fc4df50f9 (patch) | |
tree | b9f5287712f154215695c5152f3d24c391ca2ae7 /indra/llcommon/lltimer.cpp | |
parent | c58e152236abfc1c414eb6c64783334ca9555b58 (diff) | |
parent | fed6c9eb0fa58559c13729b65ecee181f58f3c69 (diff) |
automated merge viewer2.0->viewer2.0
Diffstat (limited to 'indra/llcommon/lltimer.cpp')
-rw-r--r-- | indra/llcommon/lltimer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index ef3e8dbc94..21e165ebc9 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 within its own tick() function - bad. if you want tick() to cause destruction of its own timer, make it return true. } +//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; } } |