diff options
| author | Gordon Sim <gsim@apache.org> | 2009-08-13 07:47:43 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2009-08-13 07:47:43 +0000 |
| commit | 0f4d8c56a1ad8804451ee6697186a6b0aa260e30 (patch) | |
| tree | 14ced3a6cd69d091e7a9c5666437766658f694df /cpp/src/qpid/client/StateManager.cpp | |
| parent | ba38bd2fc68d0d11574e0b00c3c79439cde3a66c (diff) | |
| download | qpid-python-0f4d8c56a1ad8804451ee6697186a6b0aa260e30.tar.gz | |
QPID-2048: Handle connection fail while attempting to close.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@803802 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/StateManager.cpp')
| -rw-r--r-- | cpp/src/qpid/client/StateManager.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cpp/src/qpid/client/StateManager.cpp b/cpp/src/qpid/client/StateManager.cpp index 9239950a3f..5462e0fed4 100644 --- a/cpp/src/qpid/client/StateManager.cpp +++ b/cpp/src/qpid/client/StateManager.cpp @@ -60,6 +60,18 @@ void StateManager::setState(int s) stateLock.notifyAll(); } +bool StateManager::setState(int s, int expected) +{ + Monitor::ScopedLock l(stateLock); + if (state == expected) { + state = s; + stateLock.notifyAll(); + return true; + } else { + return false; + } +} + int StateManager::getState() const { Monitor::ScopedLock l(stateLock); |
