summaryrefslogtreecommitdiff
path: root/qpid/cpp/test/client/client_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/test/client/client_test.cpp')
-rw-r--r--qpid/cpp/test/client/client_test.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/qpid/cpp/test/client/client_test.cpp b/qpid/cpp/test/client/client_test.cpp
index 0e57babbef..8e9c58179a 100644
--- a/qpid/cpp/test/client/client_test.cpp
+++ b/qpid/cpp/test/client/client_test.cpp
@@ -36,9 +36,7 @@ public:
inline virtual void received(Message& /*msg*/){
std::cout << "Received message " /**<< msg **/<< std::endl;
- monitor->acquire();
monitor->notify();
- monitor->release();
}
};
@@ -77,12 +75,12 @@ int main(int argc, char**)
msg.setData(data);
channel.publish(msg, exchange, "MyTopic");
std::cout << "Published message." << std::endl;
-
- monitor.acquire();
- monitor.wait();
- monitor.release();
-
+ {
+ Monitor::ScopedLock l(monitor);
+ monitor.wait();
+ }
+
con.closeChannel(&channel);
std::cout << "Closed channel." << std::endl;
con.close();