diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 2 | ||||
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 9 | ||||
-rw-r--r-- | desktop/source/app/officeipcthread.hxx | 2 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 5 |
4 files changed, 13 insertions, 5 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index c6eafe70bb46..714299e9061b 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1996,7 +1996,7 @@ IMPL_LINK_NOARG(Desktop, OpenClients_Impl, void*, void) // When this server closes down it attempts to recreate the pipe (in RequestHandler::Disable()). // It's possible that the client has a pending connection request. // When the IPC thread is not running, this connection locks (because maPipe.accept()) is never called - RequestHandler::SetReady(); + RequestHandler::SetReady(true); OpenClients(); CloseSplashScreen(); diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 7e712bc3fdd5..785cfa1d432d 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -932,6 +932,8 @@ void RequestHandler::Disable() handler->mIpcThread->join(); handler->mIpcThread.clear(); } + + handler->cReady.reset(); } } @@ -946,12 +948,15 @@ RequestHandler::~RequestHandler() assert(!mIpcThread.is()); } -void RequestHandler::SetReady() +void RequestHandler::SetReady(bool bIsReady) { osl::MutexGuard g(GetMutex()); if (pGlobal.is()) { - pGlobal->cReady.set(); + if (bIsReady) + pGlobal->cReady.set(); + else + pGlobal->cReady.reset(); } } diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx index d9d70050ded6..7c24f78fcb65 100644 --- a/desktop/source/app/officeipcthread.hxx +++ b/desktop/source/app/officeipcthread.hxx @@ -122,7 +122,7 @@ class RequestHandler: public salhelper::SimpleReferenceObject static Status Enable(bool ipc); static void Disable(); // start dispatching events... - static void SetReady(); + static void SetReady(bool bIsReady); static void WaitForReady(); bool AreRequestsEnabled() const { return mState == State::RequestsEnabled; } diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 27af7dddca77..4003d4565df5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3063,10 +3063,12 @@ static void lo_startmain(void*) { osl_setThreadName("lo_startmain"); - if (GetpApp()) + if (comphelper::SolarMutex::get()) Application::GetSolarMutex().tryToAcquire(); soffice_main(); + + Application::ReleaseSolarMutex(); } static bool bInitialized = false; @@ -3233,6 +3235,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char SAL_INFO("lok", "Enabling RequestHandler"); RequestHandler::Enable(false); SAL_INFO("lok", "Starting soffice_main"); + RequestHandler::SetReady(false); pLib->maThread = osl_createThread(lo_startmain, nullptr); SAL_INFO("lok", "Waiting for RequestHandler"); RequestHandler::WaitForReady(); |