diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-03-20 18:10:51 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-03-20 18:10:51 +0100 |
commit | ad28ffaa37e87d8d4f57dbfd5ed2eb3aae918d68 (patch) | |
tree | 39b9ab4c7800cd886ea0ce4c5478a172c3f9122f | |
parent | 36be3d94c2e142d01c026a93fa88454cb5316bff (diff) |
Remove unnecessary vcl::SolarMutexObject
Change-Id: I6dfdd7d5d211b66019dfbe364101140e28a3584d
-rw-r--r-- | include/vcl/solarmutex.hxx | 65 | ||||
-rw-r--r-- | vcl/Library_vcl.mk | 1 | ||||
-rw-r--r-- | vcl/generic/app/geninst.cxx | 6 | ||||
-rw-r--r-- | vcl/headless/svpinst.cxx | 1 | ||||
-rw-r--r-- | vcl/inc/generic/geninst.h | 8 | ||||
-rw-r--r-- | vcl/inc/headless/svpinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/osx/salinst.h | 4 | ||||
-rw-r--r-- | vcl/inc/unx/salinst.h | 1 | ||||
-rw-r--r-- | vcl/osx/salinst.cxx | 7 | ||||
-rw-r--r-- | vcl/source/app/solarmutex.cxx | 48 | ||||
-rw-r--r-- | vcl/win/source/app/salinst.cxx | 17 |
11 files changed, 22 insertions, 138 deletions
diff --git a/include/vcl/solarmutex.hxx b/include/vcl/solarmutex.hxx deleted file mode 100644 index 8c1933753636..000000000000 --- a/include/vcl/solarmutex.hxx +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOLARMUTEX_HXX -#define INCLUDED_VCL_SOLARMUTEX_HXX - -#include <comphelper/solarmutex.hxx> -#include <osl/mutex.h> -#include <vcl/dllapi.h> - -namespace vcl -{ - -/** Implementation of the SolarMutex interface. - */ -class VCL_DLLPUBLIC SolarMutexObject : public comphelper::SolarMutex -{ -public: - //static SolarMutex& SAL_CALL getGlobalMutex(); - - /** Creates mutex - */ - SolarMutexObject(); - - /** Implicitly destroys mutex - */ - virtual ~SolarMutexObject(); - - virtual void acquire(); - - virtual void release(); - - virtual bool tryToAcquire(); - -protected: - oslMutex m_solarMutex; - -private: - /* Disable copy/assignment - */ - SolarMutexObject( const SolarMutexObject& ); - SolarMutexObject& SAL_CALL operator=( const SolarMutexObject& ); -}; - -} - -#endif // INCLUDED_VCL_SOLARMUTEX_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 3cdd784209df..f5dedd791742 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -113,7 +113,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/app/IconThemeInfo \ vcl/source/app/IconThemeScanner \ vcl/source/app/IconThemeSelector \ - vcl/source/app/solarmutex \ vcl/source/app/sound \ vcl/source/app/stdtext \ vcl/source/app/svapp \ diff --git a/vcl/generic/app/geninst.cxx b/vcl/generic/app/geninst.cxx index 7d9d1b5aff81..1bb9fa4d3172 100644 --- a/vcl/generic/app/geninst.cxx +++ b/vcl/generic/app/geninst.cxx @@ -46,7 +46,7 @@ SalYieldMutex::~SalYieldMutex() void SalYieldMutex::acquire() { - SolarMutexObject::acquire(); + m_mutex.acquire(); mnThreadId = osl::Thread::getCurrentIdentifier(); mnCount++; } @@ -60,12 +60,12 @@ void SalYieldMutex::release() mnThreadId = 0; mnCount--; } - SolarMutexObject::release(); + m_mutex.release(); } bool SalYieldMutex::tryToAcquire() { - if ( SolarMutexObject::tryToAcquire() ) + if ( m_mutex.tryToAcquire() ) { mnThreadId = osl::Thread::getCurrentIdentifier(); mnCount++; diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx index b76fdf84c42c..a88243992e45 100644 --- a/vcl/headless/svpinst.cxx +++ b/vcl/headless/svpinst.cxx @@ -42,7 +42,6 @@ #include <svdata.hxx> #include <generic/gendata.hxx> #include <basebmp/scanlineformats.hxx> -#include <vcl/solarmutex.hxx> // FIXME: remove when we re-work the svp mainloop #include <unx/salunxtime.h> diff --git a/vcl/inc/generic/geninst.h b/vcl/inc/generic/geninst.h index 59ac04f0d009..0eb72ad589d0 100644 --- a/vcl/inc/generic/geninst.h +++ b/vcl/inc/generic/geninst.h @@ -20,10 +20,10 @@ #ifndef INCLUDED_VCL_INC_GENERIC_GENINST_H #define INCLUDED_VCL_INC_GENERIC_GENINST_H +#include <comphelper/solarmutex.hxx> #include <tools/solar.h> #include <osl/thread.hxx> #include <vclpluginapi.h> -#include <vcl/solarmutex.hxx> #include <salinst.hxx> #include <saldatabasic.hxx> #include <generic/genprn.h> @@ -46,8 +46,10 @@ inline SalYieldMutexReleaser::~SalYieldMutexReleaser() GetSalData()->m_pInstance->AcquireYieldMutex( m_nYieldCount ); } -class VCL_DLLPUBLIC SalYieldMutex : public vcl::SolarMutexObject +class VCL_DLLPUBLIC SalYieldMutex : public comphelper::SolarMutex { + osl::Mutex m_mutex; + protected: sal_uIntPtr mnCount; oslThreadIdentifier mnThreadId; @@ -60,7 +62,7 @@ public: virtual void release(); virtual bool tryToAcquire(); - virtual sal_uIntPtr GetAcquireCount() const { return mnCount; } + sal_uIntPtr GetAcquireCount() const { return mnCount; } oslThreadIdentifier GetThreadId() const { return mnThreadId; } }; diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx index 50b0c8b5b5c3..4a7b7b2bc421 100644 --- a/vcl/inc/headless/svpinst.hxx +++ b/vcl/inc/headless/svpinst.hxx @@ -20,8 +20,6 @@ #ifndef INCLUDED_VCL_INC_HEADLESS_SVPINST_HXX #define INCLUDED_VCL_INC_HEADLESS_SVPINST_HXX -#include <vcl/solarmutex.hxx> - #include <osl/mutex.hxx> #include <osl/thread.hxx> #include <salinst.hxx> diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h index f3a05c079e70..69261e4db077 100644 --- a/vcl/inc/osx/salinst.h +++ b/vcl/inc/osx/salinst.h @@ -23,7 +23,6 @@ #include "comphelper/solarmutex.hxx" #include "osl/thread.hxx" #include "osl/conditn.h" -#include <vcl/solarmutex.hxx> #ifdef MACOSX #include "osx/osxvcltypes.h" @@ -37,8 +36,9 @@ class AquaSalFrame; class ApplicationEvent; class Image; -class SalYieldMutex : public vcl::SolarMutexObject +class SalYieldMutex : public comphelper::SolarMutex { + osl::Mutex m_mutex; sal_uLong mnCount; oslThreadIdentifier mnThreadId; diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h index 215b3ff3b451..d91deaabba0b 100644 --- a/vcl/inc/unx/salinst.h +++ b/vcl/inc/unx/salinst.h @@ -23,7 +23,6 @@ #include <osl/thread.hxx> #include <vclpluginapi.h> #include <salinst.hxx> -#include <vcl/solarmutex.hxx> #include "generic/geninst.h" #include <prex.h> diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 28480b8e02f4..2c28ac9a915b 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -30,7 +30,6 @@ #include "vcl/svapp.hxx" #include "vcl/window.hxx" #include "vcl/timer.hxx" -#include "vcl/solarmutex.hxx" #include "osx/saldata.hxx" #include "osx/salinst.h" @@ -278,7 +277,7 @@ SalYieldMutex::SalYieldMutex() void SalYieldMutex::acquire() { - SolarMutexObject::acquire(); + m_mutex.acquire(); mnThreadId = osl::Thread::getCurrentIdentifier(); mnCount++; } @@ -291,12 +290,12 @@ void SalYieldMutex::release() mnThreadId = 0; mnCount--; } - SolarMutexObject::release(); + m_mutex.release(); } bool SalYieldMutex::tryToAcquire() { - if ( SolarMutexObject::tryToAcquire() ) + if ( m_mutex.tryToAcquire() ) { mnThreadId = osl::Thread::getCurrentIdentifier(); mnCount++; diff --git a/vcl/source/app/solarmutex.cxx b/vcl/source/app/solarmutex.cxx deleted file mode 100644 index fb5f416073d9..000000000000 --- a/vcl/source/app/solarmutex.cxx +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <vcl/solarmutex.hxx> - -using namespace vcl; - -SolarMutexObject::SolarMutexObject() : m_solarMutex( osl_createMutex() ) -{ -} - -SolarMutexObject::~SolarMutexObject() -{ - osl_destroyMutex( m_solarMutex ); -} - -void SolarMutexObject::acquire() -{ - osl_acquireMutex( m_solarMutex ); -} - -bool SolarMutexObject::tryToAcquire() -{ - return osl_tryToAcquireMutex( m_solarMutex ); -} - -void SolarMutexObject::release() -{ - osl_releaseMutex( m_solarMutex ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index 602ee8a9bc69..e831106c998d 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -30,7 +30,6 @@ #include <vcl/timer.hxx> #include <vcl/apptypes.hxx> -#include <vcl/solarmutex.hxx> #include <win/wincomp.hxx> #include <win/salids.hrc> #include <win/saldata.hxx> @@ -110,8 +109,10 @@ LRESULT CALLBACK SalComWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPa -class SalYieldMutex : public vcl::SolarMutexObject +class SalYieldMutex : public comphelper::SolarMutex { + osl::Mutex m_mutex; + public: // for ImplSalYield() WinSalInstance* mpInstData; sal_uLong mnCount; @@ -140,7 +141,7 @@ SalYieldMutex::SalYieldMutex( WinSalInstance* pInstData ) void SalYieldMutex::acquire() { - SolarMutexObject::acquire(); + m_mutex.acquire(); mnCount++; mnThreadId = GetCurrentThreadId(); } @@ -151,7 +152,7 @@ void SalYieldMutex::release() { DWORD nThreadId = GetCurrentThreadId(); if ( mnThreadId != nThreadId ) - SolarMutexObject::release(); + m_mutex.release(); else { SalData* pSalData = GetSalData(); @@ -168,13 +169,13 @@ void SalYieldMutex::release() ImplPostMessage( mpInstData->mhComWnd, SAL_MSG_RELEASEWAITYIELD, 0, 0 ); mnThreadId = 0; mnCount--; - SolarMutexObject::release(); + m_mutex.release(); mpInstData->mpSalWaitMutex->release(); } else { mnCount--; - SolarMutexObject::release(); + m_mutex.release(); } } else @@ -182,7 +183,7 @@ void SalYieldMutex::release() if ( mnCount == 1 ) mnThreadId = 0; mnCount--; - SolarMutexObject::release(); + m_mutex.release(); } } } @@ -191,7 +192,7 @@ void SalYieldMutex::release() bool SalYieldMutex::tryToAcquire() { - if( SolarMutexObject::tryToAcquire() ) + if( m_mutex.tryToAcquire() ) { mnCount++; mnThreadId = GetCurrentThreadId(); |