summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/Thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceUtil/Thread.cpp')
-rw-r--r--cpp/src/IceUtil/Thread.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp
index de1d907a4bc..c9704378849 100644
--- a/cpp/src/IceUtil/Thread.cpp
+++ b/cpp/src/IceUtil/Thread.cpp
@@ -220,6 +220,11 @@ startHook(void* arg)
IceUtil::ThreadControl
IceUtil::Thread::start()
{
+ //
+ // Keep this alive for the duration of start
+ //
+ IceUtil::ThreadPtr keepMe = this;
+
IceUtil::Mutex::Lock lock(_stateMutex);
if(_started)
@@ -501,6 +506,11 @@ startHook(void* arg)
IceUtil::ThreadControl
IceUtil::Thread::start()
{
+ //
+ // Keep this alive for the duration of start
+ //
+ IceUtil::ThreadPtr keepMe = this;
+
IceUtil::Mutex::Lock lock(_stateMutex);
if(_started)