summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-08-03 11:36:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-03 12:20:53 +0200
commit05ab38359ae72f2a54dc0b5f1b84ac5f649c507a (patch)
tree5830c7ee2442984e0bc804def7bd95ddd8a25410 /slideshow
parent5afdcad4c0e7850b18996c549892b9360cd8973f (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 'slideshow')
-rw-r--r--slideshow/source/engine/eventqueue.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/slideshow/source/engine/eventqueue.cxx b/slideshow/source/engine/eventqueue.cxx
index 0e888db85567..73bf2a398e73 100644
--- a/slideshow/source/engine/eventqueue.cxx
+++ b/slideshow/source/engine/eventqueue.cxx
@@ -77,7 +77,7 @@ namespace slideshow::internal
bool EventQueue::addEvent( const EventSharedPtr& rEvent )
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
SAL_INFO("slideshow.eventqueue", "adding event \"" << rEvent->GetDescription()
<< "\" [" << rEvent.get()
@@ -103,7 +103,7 @@ namespace slideshow::internal
bool EventQueue::addEventForNextRound( EventSharedPtr const& rEvent )
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
SAL_INFO("slideshow.eventqueue", "adding event \"" << rEvent->GetDescription()
<< "\" [" << rEvent.get()
@@ -120,7 +120,7 @@ namespace slideshow::internal
bool EventQueue::addEventWhenQueueIsEmpty (const EventSharedPtr& rpEvent)
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
SAL_INFO("slideshow.eventqueue", "adding event \"" << rpEvent->GetDescription()
<< "\" [" << rpEvent.get()
@@ -140,14 +140,14 @@ namespace slideshow::internal
void EventQueue::forceEmpty()
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
process_(true);
}
void EventQueue::process()
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
process_(false);
}
@@ -257,14 +257,14 @@ namespace slideshow::internal
bool EventQueue::isEmpty() const
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
return maEvents.empty() && maNextEvents.empty() && maNextNextEvents.empty();
}
double EventQueue::nextTimeout() const
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
// return time for next entry (if any)
double nTimeout (::std::numeric_limits<double>::max());
@@ -281,7 +281,7 @@ namespace slideshow::internal
void EventQueue::clear()
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
// TODO(P1): Maybe a plain vector and vector.swap will
// be faster here. Profile.