diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-03-11 16:10:21 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-03-11 16:42:00 +0100 |
commit | 69bb5e849825e32d9fe929519813ede56ca76997 (patch) | |
tree | 310ebb6f3321bbb392253b91a83ea7afff6df6ec | |
parent | 8db7c0de57d3c5129236fc6cfc37e93cfb75e49f (diff) |
Thread safety
Change-Id: I13282ac1d6b3f1323e9056a4160301bd503ac271
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 5662823fa59c..6bf4dc56dee1 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -666,6 +666,7 @@ OfficeIPCThread::~OfficeIPCThread() void OfficeIPCThread::SetReady() { + osl::MutexGuard g(GetMutex()); if (pGlobalOfficeIPCThread.is()) { pGlobalOfficeIPCThread->cReady.set(); @@ -674,7 +675,11 @@ void OfficeIPCThread::SetReady() void OfficeIPCThread::WaitForReady() { - rtl::Reference< OfficeIPCThread > const & t(pGlobalOfficeIPCThread); + rtl::Reference<OfficeIPCThread> t; + { + osl::MutexGuard g(GetMutex()); + t = pGlobalOfficeIPCThread; + } if (t.is()) { t->cReady.wait(); @@ -683,6 +688,7 @@ void OfficeIPCThread::WaitForReady() bool OfficeIPCThread::IsEnabled() { + osl::MutexGuard g(GetMutex()); return pGlobalOfficeIPCThread.is(); } |