summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-10 16:01:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-11 05:54:16 +0000
commitb6977dad4535532d9bd897282f52806885862c83 (patch)
treecb4f4209cf589fce1647c2d0c009b8dd5f0fefde
parent72c05eda32286703ec8315d05686d46ae824e194 (diff)
osl::Mutex->std::mutex in OSQLParser
Change-Id: Ibc56fee796914a6dd39970f7a7879d5b5b2c219f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148660 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--connectivity/source/parse/sqlbison.y3
-rw-r--r--connectivity/source/parse/sqlnode.cxx10
-rw-r--r--include/connectivity/sqlparse.hxx2
3 files changed, 7 insertions, 8 deletions
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index 6db0da9a4180..cbad86149fc2 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -4502,7 +4502,6 @@ void setParser(OSQLParser* _pParser)
void OSQLParser::setParseTree(OSQLParseNode* pNewParseTree)
{
- ::osl::MutexGuard aGuard(getMutex());
m_pParseTree.reset(pNewParseTree);
}
@@ -4574,7 +4573,7 @@ std::unique_ptr<OSQLParseNode> OSQLParser::parseTree(OUString& rErrorMessage,
// Guard the parsing
- ::osl::MutexGuard aGuard(getMutex());
+ std::unique_lock aGuard(getMutex());
// must be reset
setParser(this);
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index fecb00cdc9b2..4f213bf4f902 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1141,9 +1141,9 @@ OUString OSQLParser::stringToDouble(const OUString& _rValue,sal_Int16 _nScale)
}
-::osl::Mutex& OSQLParser::getMutex()
+std::mutex& OSQLParser::getMutex()
{
- static ::osl::Mutex aMutex;
+ static std::mutex aMutex;
return aMutex;
}
@@ -1154,7 +1154,7 @@ std::unique_ptr<OSQLParseNode> OSQLParser::predicateTree(OUString& rErrorMessage
bool bUseRealName)
{
// Guard the parsing
- ::osl::MutexGuard aGuard(getMutex());
+ std::unique_lock aGuard(getMutex());
// must be reset
setParser(this);
@@ -1322,7 +1322,7 @@ OSQLParser::OSQLParser(css::uno::Reference< css::uno::XComponentContext > xConte
#endif
#endif
- ::osl::MutexGuard aGuard(getMutex());
+ std::unique_lock aGuard(getMutex());
// Do we have to initialize the data?
if (s_nRefCount == 0)
{
@@ -1472,7 +1472,7 @@ OSQLParser::OSQLParser(css::uno::Reference< css::uno::XComponentContext > xConte
OSQLParser::~OSQLParser()
{
- ::osl::MutexGuard aGuard(getMutex());
+ std::unique_lock aGuard(getMutex());
OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : has a refcount of 0 !");
if (!--s_nRefCount)
{
diff --git a/include/connectivity/sqlparse.hxx b/include/connectivity/sqlparse.hxx
index d3eedd484137..c3314c470c6b 100644
--- a/include/connectivity/sqlparse.hxx
+++ b/include/connectivity/sqlparse.hxx
@@ -150,7 +150,7 @@ namespace connectivity
OSQLParseNode* buildNode_STR_NUM(OSQLParseNode*& pLiteral);
OSQLParseNode* buildNode_Date(const double& fValue, sal_Int32 nType);
- static ::osl::Mutex& getMutex();
+ static std::mutex& getMutex();
public:
// if NULL, a default context will be used