[Libreoffice-commits] core.git: basic/source include/tools svl/source tools/Library_tl.mk tools/source
Noel Grandin
noel at peralex.com
Fri Apr 15 08:09:22 UTC 2016
basic/source/classes/sb.cxx | 10 ++++++---
include/tools/solarmutex.hxx | 38 -----------------------------------
svl/source/svdde/ddecli.cxx | 10 ++++++---
tools/Library_tl.mk | 1
tools/source/misc/solarmutex.cxx | 42 ---------------------------------------
5 files changed, 14 insertions(+), 87 deletions(-)
New commits:
commit 494bd08c48c40d6ddd807e0ec40a315786e93975
Author: Noel Grandin <noel at peralex.com>
Date: Thu Apr 14 10:43:07 2016 +0200
remove tools/solarmutex.hxx
Deprecated in favour of comphelper::SolarMutex
Change-Id: I159077562660de5df25601fa471447f4b64a2cf1
Reviewed-on: https://gerrit.libreoffice.org/24079
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index a470547..18cc990 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -21,7 +21,7 @@
#include <tools/rcid.h>
#include <tools/stream.hxx>
#include <tools/errinf.hxx>
-#include <tools/solarmutex.hxx>
+#include <comphelper/solarmutex.hxx>
#include <basic/sbx.hxx>
#include <tools/rc.hxx>
#include <vcl/svapp.hxx>
@@ -107,7 +107,9 @@ DocBasicItem::~DocBasicItem()
// tdf#90969 HACK: don't use SolarMutexGuard - there is a horrible global
// map GaDocBasicItems holding instances, and these get deleted from exit
// handlers, when the SolarMutex is already dead
- tools::SolarMutex::Acquire();
+ comphelper::SolarMutex *pSolarMutex = comphelper::SolarMutex::get();
+ if ( pSolarMutex )
+ pSolarMutex->acquire();
try
{
@@ -119,7 +121,9 @@ DocBasicItem::~DocBasicItem()
assert(false);
}
- tools::SolarMutex::Release();
+ pSolarMutex = comphelper::SolarMutex::get();
+ if ( pSolarMutex )
+ pSolarMutex->release();
}
void DocBasicItem::clearDependingVarsOnDelete( StarBASIC& rDeletedBasic )
diff --git a/include/tools/solarmutex.hxx b/include/tools/solarmutex.hxx
deleted file mode 100644
index 60af81c..0000000
--- a/include/tools/solarmutex.hxx
+++ /dev/null
@@ -1,38 +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_TOOLS_SOLARMUTEX_HXX
-#define INCLUDED_TOOLS_SOLARMUTEX_HXX
-
-#include <tools/toolsdllapi.h>
-#include <comphelper/solarmutex.hxx>
-
-namespace tools
-{
- /// Deprecated in favour of comphelper::SolarMutex
- class TOOLS_DLLPUBLIC SolarMutex
- {
- public:
- static bool Acquire();
- static void Release();
- };
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx
index ada0d24..fd09c85 100644
--- a/svl/source/svdde/ddecli.cxx
+++ b/svl/source/svdde/ddecli.cxx
@@ -26,7 +26,7 @@
#include <osl/thread.h>
#include <tools/debug.hxx>
-#include <tools/solarmutex.hxx>
+#include <comphelper/solarmutex.hxx>
#include <osl/mutex.hxx>
namespace {
@@ -333,10 +333,14 @@ const OUString DdeTransaction::GetName() const
void DdeTransaction::Data( const DdeData* p )
{
- if ( ::tools::SolarMutex::Acquire() )
+ comphelper::SolarMutex *pSolarMutex = comphelper::SolarMutex::get();
+ if ( pSolarMutex )
{
+ pSolarMutex->acquire();
aData.Call( p );
- ::tools::SolarMutex::Release();
+ pSolarMutex = comphelper::SolarMutex::get();
+ if ( pSolarMutex )
+ pSolarMutex->release();
}
}
diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk
index 2bca4a5..2916ad3 100644
--- a/tools/Library_tl.mk
+++ b/tools/Library_tl.mk
@@ -71,7 +71,6 @@ $(eval $(call gb_Library_add_exception_objects,tl,\
tools/source/misc/cpuid \
tools/source/misc/extendapplicationenvironment \
tools/source/misc/getprocessworkingdir \
- tools/source/misc/solarmutex \
tools/source/misc/toolsdll \
tools/source/rc/rc \
tools/source/rc/resary \
diff --git a/tools/source/misc/solarmutex.cxx b/tools/source/misc/solarmutex.cxx
deleted file mode 100644
index 6602939..0000000
--- a/tools/source/misc/solarmutex.cxx
+++ /dev/null
@@ -1,42 +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 <tools/solarmutex.hxx>
-
-namespace tools
-{
- bool SolarMutex::Acquire()
- {
- comphelper::SolarMutex *pSolarMutex = comphelper::SolarMutex::get();
- if ( pSolarMutex )
- pSolarMutex->acquire();
- else
- return false;
- return true;
- }
-
- void SolarMutex::Release()
- {
- comphelper::SolarMutex *pSolarMutex = comphelper::SolarMutex::get();
- if ( pSolarMutex )
- pSolarMutex->release();
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list