summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-03-18 15:44:01 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-03-18 17:37:53 +0100
commitcb5e194ce3bb744b0d70528205cdc391af6813bf (patch)
tree36e9fe02eca530f6fd7fac96c2f632a625a89296 /framework/source
parent7ec5922615c4e247b9cecaf146bd1f9933d79699 (diff)
Use SolarMutexGuard directly
Change-Id: I2e30bc8af2489d838f8a06f62667777eaeac061a
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/jobs/jobdispatch.cxx30
1 files changed, 11 insertions, 19 deletions
diff --git a/framework/source/jobs/jobdispatch.cxx b/framework/source/jobs/jobdispatch.cxx
index f39a26cb45f5..22170af5c3d3 100644
--- a/framework/source/jobs/jobdispatch.cxx
+++ b/framework/source/jobs/jobdispatch.cxx
@@ -20,8 +20,6 @@
#include <jobs/configaccess.hxx>
#include <jobs/joburl.hxx>
#include <jobs/job.hxx>
-#include <threadhelp/guard.hxx>
-#include <threadhelp/threadhelpbase.hxx>
#include <classes/converter.hxx>
#include <general.h>
@@ -58,8 +56,7 @@ namespace {
real job. We do it, control the life cycle of this internal
wrapped job and inform any interested listener if it finish.
*/
-class JobDispatch : private ThreadHelpBase
- , public ::cppu::WeakImplHelper4<
+class JobDispatch : public ::cppu::WeakImplHelper4<
css::lang::XServiceInfo
, css::lang::XInitialization
, css::frame::XDispatchProvider
@@ -148,8 +145,7 @@ public:
reference to the uno service manager
*/
JobDispatch::JobDispatch( /*IN*/ const css::uno::Reference< css::uno::XComponentContext >& xContext )
- : ThreadHelpBase(&Application::GetSolarMutex())
- , m_xContext (xContext )
+ : m_xContext (xContext )
{
}
@@ -178,8 +174,7 @@ JobDispatch::~JobDispatch()
void SAL_CALL JobDispatch::initialize( const css::uno::Sequence< css::uno::Any >& lArguments ) throw(css::uno::Exception ,
css::uno::RuntimeException, std::exception)
{
- /* SAFE { */
- Guard aWriteLock(m_aLock);
+ SolarMutexGuard g;
for (int a=0; a<lArguments.getLength(); ++a)
{
@@ -197,9 +192,6 @@ void SAL_CALL JobDispatch::initialize( const css::uno::Sequence< css::uno::Any >
{}
}
}
-
- aWriteLock.unlock();
- /* } SAFE */
}
@@ -328,9 +320,9 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const OUString&
// The called static helper methods read it from the configuration and
// filter disabled jobs using it's time stamp values.
/* SAFE { */
- Guard aReadLock(m_aLock);
+ SolarMutexResettableGuard aReadLock;
css::uno::Sequence< OUString > lJobs = JobData::getEnabledJobsForEvent(m_xContext, sEvent);
- aReadLock.unlock();
+ aReadLock.clear();
/* } SAFE */
css::uno::Reference< css::frame::XDispatchResultListener > xThis( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY );
@@ -344,7 +336,7 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const OUString&
for (int j=0; j<lJobs.getLength(); ++j)
{
/* SAFE { */
- aReadLock.lock();
+ aReadLock.reset();
JobData aCfg(m_xContext);
aCfg.setEvent(sEvent, lJobs[j]);
@@ -360,7 +352,7 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const OUString&
css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
pJob->setJobData(aCfg);
- aReadLock.unlock();
+ aReadLock.clear();
/* } SAFE */
if (!bIsEnabled)
@@ -408,7 +400,7 @@ void JobDispatch::impl_dispatchService( /*IN*/ const OUString&
/*IN*/ const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
{
/* SAFE { */
- Guard aReadLock(m_aLock);
+ SolarMutexClearableGuard aReadLock;
JobData aCfg(m_xContext);
aCfg.setService(sService);
@@ -423,7 +415,7 @@ void JobDispatch::impl_dispatchService( /*IN*/ const OUString&
css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
pJob->setJobData(aCfg);
- aReadLock.unlock();
+ aReadLock.clear();
/* } SAFE */
css::uno::Reference< css::frame::XDispatchResultListener > xThis( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY );
@@ -459,7 +451,7 @@ void JobDispatch::impl_dispatchAlias( /*IN*/ const OUString&
/*IN*/ const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
{
/* SAFE { */
- Guard aReadLock(m_aLock);
+ SolarMutexClearableGuard aReadLock;
JobData aCfg(m_xContext);
aCfg.setAlias(sAlias);
@@ -474,7 +466,7 @@ void JobDispatch::impl_dispatchAlias( /*IN*/ const OUString&
css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
pJob->setJobData(aCfg);
- aReadLock.unlock();
+ aReadLock.clear();
/* } SAFE */
css::uno::Reference< css::frame::XDispatchResultListener > xThis( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY );