diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-03 11:36:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-03 12:20:53 +0200 |
commit | 05ab38359ae72f2a54dc0b5f1b84ac5f649c507a (patch) | |
tree | 5830c7ee2442984e0bc804def7bd95ddd8a25410 /vcl | |
parent | 5afdcad4c0e7850b18996c549892b9360cd8973f (diff) |
Consolidate on C++17 std::scoped_lock instead of std::lock_guard
as in commit 9376f65a26240441bf9dd6ae1f69886dc9fa60fa
Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/jsdialog/jsdialogbuilder.cxx | 4 | ||||
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 4 | ||||
-rw-r--r-- | vcl/source/graphic/UnoGraphicObject.cxx | 4 | ||||
-rw-r--r-- | vcl/source/helper/displayconnectiondispatch.cxx | 8 | ||||
-rw-r--r-- | vcl/source/treelist/transfer2.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/dndeventdispatcher.cxx | 12 | ||||
-rw-r--r-- | vcl/unx/generic/printer/ppdparser.cxx | 2 |
7 files changed, 19 insertions, 19 deletions
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index d631527af6e0..c3f4e2ac6310 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -101,7 +101,7 @@ OUString extractActionType(const ActionDataMap& rData) void JSDialogNotifyIdle::sendMessage(jsdialog::MessageType eType, VclPtr<vcl::Window> pWindow, std::unique_ptr<ActionDataMap> pData) { - std::lock_guard aGuard(m_aQueueMutex); + std::scoped_lock aGuard(m_aQueueMutex); // we want only the latest update of same type // TODO: also if we met full update - previous updates are not valid @@ -261,7 +261,7 @@ void JSDialogNotifyIdle::Invoke() { std::deque<JSDialogMessageInfo> aMessageQueue; { - std::lock_guard aGuard(m_aQueueMutex); + std::scoped_lock aGuard(m_aQueueMutex); std::swap(aMessageQueue, m_aMessageQueue); } diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 55238a09729f..b0ee96a0e54c 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -325,7 +325,7 @@ GraphicFilter::GraphicFilter( bool bConfig ) GraphicFilter::~GraphicFilter() { { - std::lock_guard aGuard( getListMutex() ); + std::scoped_lock aGuard( getListMutex() ); auto it = std::find(gaFilterHdlList.begin(), gaFilterHdlList.end(), this); if( it != gaFilterHdlList.end() ) gaFilterHdlList.erase( it ); @@ -340,7 +340,7 @@ GraphicFilter::~GraphicFilter() void GraphicFilter::ImplInit() { { - std::lock_guard aGuard( getListMutex() ); + std::scoped_lock aGuard( getListMutex() ); if ( gaFilterHdlList.empty() ) pConfig = new FilterConfigCache( bUseConfig ); diff --git a/vcl/source/graphic/UnoGraphicObject.cxx b/vcl/source/graphic/UnoGraphicObject.cxx index 69cbd6daa048..978983715a1c 100644 --- a/vcl/source/graphic/UnoGraphicObject.cxx +++ b/vcl/source/graphic/UnoGraphicObject.cxx @@ -71,7 +71,7 @@ GraphicObjectImpl::GraphicObjectImpl(const uno::Sequence<uno::Any>& /*rArgs*/) uno::Reference<graphic::XGraphic> SAL_CALL GraphicObjectImpl::getGraphic() { - std::lock_guard aGuard(m_aMutex); + std::scoped_lock aGuard(m_aMutex); if (!mpGraphicObject) throw uno::RuntimeException(); @@ -80,7 +80,7 @@ uno::Reference<graphic::XGraphic> SAL_CALL GraphicObjectImpl::getGraphic() void SAL_CALL GraphicObjectImpl::setGraphic(uno::Reference<graphic::XGraphic> const & rxGraphic) { - std::lock_guard aGuard(m_aMutex); + std::scoped_lock aGuard(m_aMutex); if (!mpGraphicObject) throw uno::RuntimeException(); diff --git a/vcl/source/helper/displayconnectiondispatch.cxx b/vcl/source/helper/displayconnectiondispatch.cxx index 72c3a435a57c..664446cd8812 100644 --- a/vcl/source/helper/displayconnectiondispatch.cxx +++ b/vcl/source/helper/displayconnectiondispatch.cxx @@ -56,7 +56,7 @@ void DisplayConnectionDispatch::terminate() SolarMutexReleaser aRel; - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); Any aEvent; std::vector< css::uno::Reference< XEventHandler > > aLocalList( m_aHandlers ); for (auto const& elem : aLocalList) @@ -65,14 +65,14 @@ void DisplayConnectionDispatch::terminate() void SAL_CALL DisplayConnectionDispatch::addEventHandler( const Any& /*window*/, const css::uno::Reference< XEventHandler >& handler, sal_Int32 /*eventMask*/ ) { - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); m_aHandlers.push_back( handler ); } void SAL_CALL DisplayConnectionDispatch::removeEventHandler( const Any& /*window*/, const css::uno::Reference< XEventHandler >& handler ) { - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); m_aHandlers.erase( std::remove(m_aHandlers.begin(), m_aHandlers.end(), handler), m_aHandlers.end() ); } @@ -99,7 +99,7 @@ bool DisplayConnectionDispatch::dispatchEvent( void const * pData, int nBytes ) aEvent <<= aSeq; ::std::vector< css::uno::Reference< XEventHandler > > handlers; { - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); handlers = m_aHandlers; } for (auto const& handle : handlers) diff --git a/vcl/source/treelist/transfer2.cxx b/vcl/source/treelist/transfer2.cxx index 58e217996350..9fdeae5071cc 100644 --- a/vcl/source/treelist/transfer2.cxx +++ b/vcl/source/treelist/transfer2.cxx @@ -83,7 +83,7 @@ void DragSourceHelper::dispose() { Reference<XDragGestureRecognizer> xTmp; { - std::lock_guard aGuard( maMutex ); + std::scoped_lock aGuard( maMutex ); xTmp = std::move(mxDragGestureRecognizer); } if( xTmp.is() ) @@ -244,7 +244,7 @@ void DropTargetHelper::dispose() { Reference< XDropTarget > xTmp; { - std::lock_guard aGuard( maMutex ); + std::scoped_lock aGuard( maMutex ); xTmp = std::move(mxDropTarget); } if( xTmp.is() ) diff --git a/vcl/source/window/dndeventdispatcher.cxx b/vcl/source/window/dndeventdispatcher.cxx index f5083437c5f6..b8190a118fd5 100644 --- a/vcl/source/window/dndeventdispatcher.cxx +++ b/vcl/source/window/dndeventdispatcher.cxx @@ -86,7 +86,7 @@ void DNDEventDispatcher::designate_currentwindow(vcl::Window *pWindow) void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde ) { - std::lock_guard aImplGuard( m_aMutex ); + std::scoped_lock aImplGuard( m_aMutex ); Point location( dtde.LocationX, dtde.LocationY ); @@ -119,7 +119,7 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde ) void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtdee ) { - std::lock_guard aImplGuard( m_aMutex ); + std::scoped_lock aImplGuard( m_aMutex ); Point location( dtdee.LocationX, dtdee.LocationY ); vcl::Window * pChildWindow = findTopLevelWindow(location); @@ -142,7 +142,7 @@ void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtd void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ ) { - std::lock_guard aImplGuard( m_aMutex ); + std::scoped_lock aImplGuard( m_aMutex ); fireDragExitEvent( m_pCurrentWindow ); @@ -153,7 +153,7 @@ void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ ) void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde ) { - std::lock_guard aImplGuard( m_aMutex ); + std::scoped_lock aImplGuard( m_aMutex ); Point location( dtde.LocationX, dtde.LocationY ); sal_Int32 nListeners; @@ -189,7 +189,7 @@ void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde ) void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent& dtde ) { - std::lock_guard aImplGuard( m_aMutex ); + std::scoped_lock aImplGuard( m_aMutex ); Point location( dtde.LocationX, dtde.LocationY ); sal_Int32 nListeners; @@ -225,7 +225,7 @@ void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent& void SAL_CALL DNDEventDispatcher::dragGestureRecognized( const DragGestureEvent& dge ) { - std::lock_guard aImplGuard( m_aMutex ); + std::scoped_lock aImplGuard( m_aMutex ); Point origin( dge.DragOriginX, dge.DragOriginY ); diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index d049a67d60c7..4b4286273099 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -535,7 +535,7 @@ OUString PPDParser::getPPDFile( const OUString& rFile ) const PPDParser* PPDParser::getParser( const OUString& rFile ) { static std::recursive_mutex aMutex; - std::lock_guard aGuard( aMutex ); + std::scoped_lock aGuard( aMutex ); OUString aFile = rFile; if( !rFile.startsWith( "CUPS:" ) && !rFile.startsWith( "CPD:" ) ) |