Kaydet (Commit) 69bb5e84 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Thread safety

Change-Id: I13282ac1d6b3f1323e9056a4160301bd503ac271
üst 8db7c0de
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment