summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-03-10 19:08:18 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-03-10 19:08:18 +0000
commit2d9d07806037ce5e91dd0bad53fdfbe25ca5f8b1 (patch)
treec7f9e0d97fe0c6e8e76ab822d87066acec25d935 /cpp/src
parentf4b410ff24f04433b5a2b72a5e05033d8b7bff67 (diff)
downloadqpid-python-2d9d07806037ce5e91dd0bad53fdfbe25ca5f8b1.tar.gz
Really close the potential race on the client between sending
and closing a connection git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@752220 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/client/Connector.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/cpp/src/qpid/client/Connector.cpp b/cpp/src/qpid/client/Connector.cpp
index bf1627bbff..c251233082 100644
--- a/cpp/src/qpid/client/Connector.cpp
+++ b/cpp/src/qpid/client/Connector.cpp
@@ -92,8 +92,6 @@ class TCPConnector : public Connector, public sys::Codec, private sys::Runnable
framing::ProtocolVersion version;
bool initiated;
-
- sys::Mutex closedLock;
bool closed;
bool joined;
@@ -185,7 +183,7 @@ TCPConnector::~TCPConnector() {
}
void TCPConnector::connect(const std::string& host, int port){
- Mutex::ScopedLock l(closedLock);
+ Mutex::ScopedLock l(lock);
assert(closed);
try {
socket.connect(host, port);
@@ -207,7 +205,7 @@ void TCPConnector::connect(const std::string& host, int port){
}
void TCPConnector::init(){
- Mutex::ScopedLock l(closedLock);
+ Mutex::ScopedLock l(lock);
assert(joined);
ProtocolInitiation init(version);
writeDataBlock(init);
@@ -218,7 +216,7 @@ void TCPConnector::init(){
bool TCPConnector::closeInternal() {
bool ret;
{
- Mutex::ScopedLock l(closedLock);
+ Mutex::ScopedLock l(lock);
ret = !closed;
if (!closed) {
closed = true;