summaryrefslogtreecommitdiff
path: root/cpp/src/Ice
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2019-06-28 15:00:37 +0200
committerBenoit Foucher <benoit@zeroc.com>2019-06-28 15:00:37 +0200
commitaf4b16cd5756a549d561c23cda906161c4d219b8 (patch)
treed67f5e45695a15b42c8b98259ad45db03017fc5e /cpp/src/Ice
parentAdded back caching of output stream, fixes #414 (#415) (diff)
downloadice-af4b16cd5756a549d561c23cda906161c4d219b8.tar.bz2
ice-af4b16cd5756a549d561c23cda906161c4d219b8.tar.xz
ice-af4b16cd5756a549d561c23cda906161c4d219b8.zip
Fixed timer to release task outside the synchronization block, fixes #352
Diffstat (limited to 'cpp/src/Ice')
-rw-r--r--cpp/src/Ice/Timer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpp/src/Ice/Timer.cpp b/cpp/src/Ice/Timer.cpp
index e573b905a9d..4f4e2e3f030 100644
--- a/cpp/src/Ice/Timer.cpp
+++ b/cpp/src/Ice/Timer.cpp
@@ -242,6 +242,16 @@ Timer::run()
{
consoleErr << "IceUtil::Timer::run(): uncaught exception" << endl;
}
+
+ if(token.delay == IceUtil::Time())
+ {
+ //
+ // If thisthe task is not a repeated task, clear the task reference now rather than
+ // in the synchronization block above. Clearing the task reference might end up
+ // calling user code which could trigger a deadlock. See also issue #352.
+ //
+ token.task = ICE_NULLPTR;
+ }
}
}
}