[Libreoffice-commits] core.git: include/vcl vcl/generic vcl/headless vcl/inc vcl/Library_vcl.mk vcl/osx vcl/source vcl/win

Stephan Bergmann sbergman at redhat.com
Thu Mar 20 10:11:41 PDT 2014


 include/vcl/solarmutex.hxx     |   65 -----------------------------------------
 vcl/Library_vcl.mk             |    1 
 vcl/generic/app/geninst.cxx    |    6 +--
 vcl/headless/svpinst.cxx       |    1 
 vcl/inc/generic/geninst.h      |    8 +++--
 vcl/inc/headless/svpinst.hxx   |    2 -
 vcl/inc/osx/salinst.h          |    4 +-
 vcl/inc/unx/salinst.h          |    1 
 vcl/osx/salinst.cxx            |    7 +---
 vcl/source/app/solarmutex.cxx  |   48 ------------------------------
 vcl/win/source/app/salinst.cxx |   17 +++++-----
 11 files changed, 22 insertions(+), 138 deletions(-)

New commits:
commit ad28ffaa37e87d8d4f57dbfd5ed2eb3aae918d68
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 18:10:51 2014 +0100

    Remove unnecessary vcl::SolarMutexObject
    
    Change-Id: I6dfdd7d5d211b66019dfbe364101140e28a3584d

diff --git a/include/vcl/solarmutex.hxx b/include/vcl/solarmutex.hxx
deleted file mode 100644
index 8c19337..0000000
--- 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 3cdd784..f5dedd7 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 7d9d1b5..1bb9fa4 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 b76fdf8..a882439 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 59ac04f..0eb72ad 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 50b0c8b..4a7b7b2 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 f3a05c0..69261e4 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 215b3ff..d91deaa 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 28480b8..2c28ac9 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 fb5f416..0000000
--- 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 602ee8a..e831106 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();


More information about the Libreoffice-commits mailing list