summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-04-29 01:17:09 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-04-29 01:17:09 +0000
commit256335fe025a3ea57f3c56bfac7c143d4cafd326 (patch)
tree24619a7f651c02314e851cffed824a603b9ecac5 /qpid/cpp/src
parent3d785d35f8ece5a0d80429665d65cf1844f75bf2 (diff)
downloadqpid-python-256335fe025a3ea57f3c56bfac7c143d4cafd326.tar.gz
QPID-2186: Small adjustments to previous fix:
- Turn one of the "if"s into an assert - Fix incorrect scope for unlocking Timer monitor around fire() callback. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@939156 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/sys/Timer.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/qpid/cpp/src/qpid/sys/Timer.cpp b/qpid/cpp/src/qpid/sys/Timer.cpp
index 55c48c5b9c..26d16e5188 100644
--- a/qpid/cpp/src/qpid/sys/Timer.cpp
+++ b/qpid/cpp/src/qpid/sys/Timer.cpp
@@ -7,9 +7,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -84,7 +84,7 @@ Timer::Timer() :
start();
}
-Timer::~Timer()
+Timer::~Timer()
{
stop();
}
@@ -114,8 +114,10 @@ void Timer::run()
}
continue;
} else if(Duration(t->nextFireTime, start) >= 0) {
+ {
Monitor::ScopedUnlock u(monitor);
fire(t);
+ }
// Warn if callback overran next timer's start.
AbsTime end(AbsTime::now());
Duration overrun (0);
@@ -149,8 +151,8 @@ void Timer::run()
tasks.push(t);
}
}
- if (!tasks.empty())
- monitor.wait(tasks.top()->sortTime);
+ assert(!tasks.empty());
+ monitor.wait(tasks.top()->sortTime);
}
}
}