summaryrefslogtreecommitdiffstats
path: root/framework/source/jobs/job.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/jobs/job.cxx')
-rw-r--r--framework/source/jobs/job.cxx25
1 files changed, 19 insertions, 6 deletions
diff --git a/framework/source/jobs/job.cxx b/framework/source/jobs/job.cxx
index 39b867ac3291..d2d9403e4ab2 100644
--- a/framework/source/jobs/job.cxx
+++ b/framework/source/jobs/job.cxx
@@ -156,6 +156,18 @@ void Job::setJobData( const JobData& aData )
void Job::execute( /*IN*/ const css::uno::Sequence< css::beans::NamedValue >& lDynamicArgs )
{
/* SAFE { */
+ class SolarMutexAntiGuard {
+ SolarMutexResettableGuard & m_rGuard;
+ public:
+ SolarMutexAntiGuard(SolarMutexResettableGuard & rGuard) : m_rGuard(rGuard)
+ {
+ m_rGuard.clear();
+ }
+ ~SolarMutexAntiGuard()
+ {
+ m_rGuard.reset();
+ }
+ };
SolarMutexResettableGuard aWriteLock;
// reject dangerous calls
@@ -191,23 +203,24 @@ void Job::execute( /*IN*/ const css::uno::Sequence< css::beans::NamedValue >& lD
if (xAJob.is())
{
m_aAsyncWait.reset();
- aWriteLock.clear();
+ SolarMutexAntiGuard const ag(aWriteLock);
/* } SAFE */
xAJob->executeAsync(lJobArgs, xThis);
// wait for finishing this job - so this method
// does the same for synchronous and asynchronous jobs!
m_aAsyncWait.wait();
- aWriteLock.reset();
/* SAFE { */
// Note: Result handling was already done inside the callback!
}
// execute it synchron
else if (xSJob.is())
{
- aWriteLock.clear();
- /* } SAFE */
- css::uno::Any aResult = xSJob->execute(lJobArgs);
- aWriteLock.reset();
+ css::uno::Any aResult;
+ {
+ SolarMutexAntiGuard const ag(aWriteLock);
+ /* } SAFE */
+ aResult = xSJob->execute(lJobArgs);
+ }
/* SAFE { */
impl_reactForJobResult(aResult);
}