diff options
author | Alan Conway <aconway@apache.org> | 2007-11-07 23:18:04 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-11-07 23:18:04 +0000 |
commit | 4a99f6ff8be3aba1deeb4fb50c09304c800a3a5d (patch) | |
tree | 04188f4ab5b2e6a6d8bd7c477e8d192940b0fd74 /qpid/cpp/src/tests/perftest.cpp | |
parent | 36bcdd74534cd7896ba3be055936bf1a1829af70 (diff) | |
download | qpid-python-4a99f6ff8be3aba1deeb4fb50c09304c800a3a5d.tar.gz |
Fix race condition in perftest.
NOTE: in multi-process mode you must run the publisher first and wait
for it to show "waiting for consumers" before starting consumers.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@592946 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/perftest.cpp')
-rw-r--r-- | qpid/cpp/src/tests/perftest.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/perftest.cpp b/qpid/cpp/src/tests/perftest.cpp index d9316527bc..5d412d3837 100644 --- a/qpid/cpp/src/tests/perftest.cpp +++ b/qpid/cpp/src/tests/perftest.cpp @@ -71,15 +71,17 @@ struct PublishThread : public Runnable { Thread thread; void run(); }; // Create and purge the shared queues void setup() { - cout << "Create shared queues" << endl; Connection connection; opts.open(connection); Session_0_10 session = connection.newSession(); session.setSynchronous(true); // Make sure this is all completed. session.queueDeclare(arg::queue="control"); // Control queue - session.queuePurge(arg::queue="control"); - if (mode==SHARED) { + if (!opts.publish) + return; // Only do this in publish thread. + if (mode==SHARED) session.queueDeclare(arg::queue="perftest"); // Shared data queue + if (opts.publish) { // Only do this in the publisher process. + session.queuePurge(arg::queue="control"); session.queuePurge(arg::queue="perftest"); } session.close(); |