summaryrefslogtreecommitdiff
path: root/cpp/src/IceStorm/OnewayBatchSubscriber.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2004-10-01 19:12:47 +0000
committerBernard Normier <bernard@zeroc.com>2004-10-01 19:12:47 +0000
commitaf7f162c6647a2c114551b5802a1f8ce4338f30d (patch)
tree32bd8813f52834993d3955f960927337d65de543 /cpp/src/IceStorm/OnewayBatchSubscriber.cpp
parentAdded error checking (diff)
downloadice-af7f162c6647a2c114551b5802a1f8ce4338f30d.tar.bz2
ice-af7f162c6647a2c114551b5802a1f8ce4338f30d.tar.xz
ice-af7f162c6647a2c114551b5802a1f8ce4338f30d.zip
Deadlock fix
Diffstat (limited to 'cpp/src/IceStorm/OnewayBatchSubscriber.cpp')
-rw-r--r--cpp/src/IceStorm/OnewayBatchSubscriber.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/cpp/src/IceStorm/OnewayBatchSubscriber.cpp b/cpp/src/IceStorm/OnewayBatchSubscriber.cpp
index b7af68f0c5f..ec27c7c0610 100644
--- a/cpp/src/IceStorm/OnewayBatchSubscriber.cpp
+++ b/cpp/src/IceStorm/OnewayBatchSubscriber.cpp
@@ -45,8 +45,10 @@ OnewayBatchSubscriber::activate()
void
OnewayBatchSubscriber::unsubscribe()
{
- IceUtil::Mutex::Lock sync(_stateMutex);
- _state = StateUnsubscribed;
+ {
+ IceUtil::Mutex::Lock sync(_stateMutex);
+ _state = StateUnsubscribed;
+ }
if(_traceLevels->subscriber > 0)
{
@@ -64,8 +66,10 @@ OnewayBatchSubscriber::unsubscribe()
void
OnewayBatchSubscriber::replace()
{
- IceUtil::Mutex::Lock sync(_stateMutex);
- _state = StateReplaced;
+ {
+ IceUtil::Mutex::Lock sync(_stateMutex);
+ _state = StateReplaced;
+ }
if(_traceLevels->subscriber > 0)
{