summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPranav Kant <pranav913@gmail.com>2015-03-17 12:56:54 +0530
committerStephan Bergmann <sbergman@redhat.com>2015-03-20 12:18:02 +0000
commit33de587e95dddfc8e3c89b84f90b3d1bca823dae (patch)
treec65ada218c27ae4f2e80b4e3476b67c8e4554ef8 /desktop
parent9e2e9453cbca9399e1c670b354cfc3c23d70307f (diff)
tdf#88230: cleanup solar mutex yielding
Use SolarMutexReleaser, instead. Change-Id: I276459c42b688813ea168d6fc80466a07a5ecba4 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx33
1 files changed, 17 insertions, 16 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 62402e01b904..cd9809da2f1a 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1588,22 +1588,22 @@ int Desktop::Main()
}
// Release solar mutex just before we wait for our client to connect
- int nAcquireCount = Application::ReleaseSolarMutex();
+ {
+ SolarMutexReleaser aReleaser;
- // Post user event to startup first application component window
- // We have to send this OpenClients message short before execute() to
- // minimize the risk that this message overtakes type detection construction!!
- Application::PostUserEvent( LINK( this, Desktop, OpenClients_Impl ) );
+ // Post user event to startup first application component window
+ // We have to send this OpenClients message short before execute() to
+ // minimize the risk that this message overtakes type detection construction!!
+ Application::PostUserEvent( LINK( this, Desktop, OpenClients_Impl ) );
- // Post event to enable acceptors
- Application::PostUserEvent( LINK( this, Desktop, EnableAcceptors_Impl) );
+ // Post event to enable acceptors
+ Application::PostUserEvent( LINK( this, Desktop, EnableAcceptors_Impl) );
- // The configuration error handler currently is only for startup
- aConfigErrHandler.deactivate();
+ // The configuration error handler currently is only for startup
+ aConfigErrHandler.deactivate();
- // Acquire solar mutex just before we enter our message loop
- if ( nAcquireCount )
- Application::AcquireSolarMutex( nAcquireCount );
+ // Acquire solar mutex just before we enter our message loop
+ }
// call Application::Execute to process messages in vcl message loop
SAL_INFO( "desktop.app", "PERFORMANCE - enter Application::Execute()" );
@@ -1711,12 +1711,13 @@ int Desktop::doShutdown()
FlushConfiguration();
// The acceptors in the AcceptorMap must be released (in DeregisterServices)
// with the solar mutex unlocked, to avoid deadlock:
- sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
- DeregisterServices();
+ {
+ SolarMutexReleaser aReleaser;
+ DeregisterServices();
#if HAVE_FEATURE_SCRIPTING
- StarBASIC::DetachAllDocBasicItems();
+ StarBASIC::DetachAllDocBasicItems();
#endif
- Application::AcquireSolarMutex(nAcquireCount);
+ }
// be sure that path/language options gets destroyed before
// UCB is deinitialized
SAL_INFO( "desktop.app", "-> dispose path/language options" );