summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltimer.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-02-04 10:22:28 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-02-04 10:22:28 -0500
commit76cf7ebf7037c2e579861c64c38fc24bde165669 (patch)
tree72152ff4ae4cb5f6422cd8c4c9830b4f76c3aa21 /indra/llcommon/lltimer.cpp
parentd2d192060993d938a2fd131f8872a60b678e4a04 (diff)
parent9a15ee8a91a12020b22625873c280837739f946c (diff)
merge
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..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;
}
}