summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/ProducerConsumerTest.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2007-05-22 15:18:08 +0000
committerAndrew Stitcher <astitcher@apache.org>2007-05-22 15:18:08 +0000
commitaf7605eecb75d40e9d1c7b8fc32f59a51c00e1d5 (patch)
treeca436dfecd1301234765661654cc5204017ce6a0 /qpid/cpp/src/tests/ProducerConsumerTest.cpp
parent98d79fa020c71de88eca07b526008ca25e7cb193 (diff)
downloadqpid-python-af7605eecb75d40e9d1c7b8fc32f59a51c00e1d5.tar.gz
* Split apart platform (threading etc.) from network io
you can now use a posix platform implementation by configuring --disable-apr-platform * Changed Time classes to distinguish between absolute times (AbsTime) and durations (Duration). This should avoid bugs caused by confusing the two types of time. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@540608 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ProducerConsumerTest.cpp')
-rw-r--r--qpid/cpp/src/tests/ProducerConsumerTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/qpid/cpp/src/tests/ProducerConsumerTest.cpp b/qpid/cpp/src/tests/ProducerConsumerTest.cpp
index 410a846b8b..789e365a85 100644
--- a/qpid/cpp/src/tests/ProducerConsumerTest.cpp
+++ b/qpid/cpp/src/tests/ProducerConsumerTest.cpp
@@ -74,9 +74,9 @@ class WatchedCounter : public Monitor {
return count;
}
- bool waitFor(int i, Time timeout=TIME_SEC) {
+ bool waitFor(int i, Duration timeout=TIME_SEC) {
Lock l(*this);
- Time deadline = timeout+now();
+ AbsTime deadline(now(), timeout);
while (count != i) {
if (!wait(deadline))
return false;
@@ -116,8 +116,8 @@ class ProducerConsumerTest : public CppUnit::TestCase
struct ConsumeTimeoutRunnable : public Runnable {
ProducerConsumerTest& test;
- Time timeout;
- ConsumeTimeoutRunnable(ProducerConsumerTest& test_, const Time& t)
+ Duration timeout;
+ ConsumeTimeoutRunnable(ProducerConsumerTest& test_, const Duration& t)
: test(test_), timeout(t) {}
void run() { test.consumeTimeout(timeout); }
};
@@ -143,7 +143,7 @@ class ProducerConsumerTest : public CppUnit::TestCase
consumeInternal(consumer);
};
- void consumeTimeout(const Time& timeout) {
+ void consumeTimeout(const Duration& timeout) {
ProducerConsumer::ConsumerLock consumer(pc, timeout);
consumeInternal(consumer);
};