summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/PollableQueue.h
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-04-21 22:07:04 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-04-21 22:07:04 +0000
commit49058d80637096b65b198d4dce7fb98a1151d2b0 (patch)
tree2d2c6d77130f2337015c66b62df2ec125d211320 /cpp/src/qpid/sys/PollableQueue.h
parent26d81efa13c8878f4584a721a3f0ea72ce27775f (diff)
downloadqpid-python-49058d80637096b65b198d4dce7fb98a1151d2b0.tar.gz
QPID-2527: Remove Thread::id member as its uses are better implemented by comparison
operators. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@936537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/PollableQueue.h')
-rw-r--r--cpp/src/qpid/sys/PollableQueue.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpp/src/qpid/sys/PollableQueue.h b/cpp/src/qpid/sys/PollableQueue.h
index cb8c126fe6..81c2301c1e 100644
--- a/cpp/src/qpid/sys/PollableQueue.h
+++ b/cpp/src/qpid/sys/PollableQueue.h
@@ -132,7 +132,7 @@ template <class T> void PollableQueue<T>::push(const T& t) {
template <class T> void PollableQueue<T>::dispatch(PollableCondition& cond) {
ScopedLock l(lock);
- assert(dispatcher.id() == 0);
+ assert(!dispatcher);
dispatcher = Thread::current();
process();
dispatcher = Thread();
@@ -167,8 +167,8 @@ template <class T> void PollableQueue<T>::stop() {
condition.clear();
stopped = true;
// Avoid deadlock if stop is called from the dispatch thread
- if (dispatcher.id() != Thread::current().id())
- while (dispatcher.id()) lock.wait();
+ if (dispatcher && dispatcher != Thread::current())
+ while (dispatcher) lock.wait();
}
}} // namespace qpid::sys