diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-06-20 09:03:25 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-06-20 10:19:33 +0200 |
commit | 6ad13e0e5d1caa8e1ffcf7092e1c04011b5df055 (patch) | |
tree | 7c23a0cecafd94959d26909cfe0199f5e7f20253 /comphelper | |
parent | b520005b1d42ce80296cbbc6b4fc3cc5e5d8cae0 (diff) |
Demote from std::unique_lock to std::scoped_lock where applicable
Change-Id: I53a019f05978bab62ad0da3d0eb08f37f8ec1e18
Reviewed-on: https://gerrit.libreoffice.org/74414
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/threadpool.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx index e1b256736cfe..edef87a844f2 100644 --- a/comphelper/source/misc/threadpool.cxx +++ b/comphelper/source/misc/threadpool.cxx @@ -189,7 +189,7 @@ void ThreadPool::shutdownLocked(std::unique_lock<std::mutex>& aGuard) void ThreadPool::pushTask( std::unique_ptr<ThreadTask> pTask ) { - std::unique_lock< std::mutex > aGuard( maMutex ); + std::scoped_lock< std::mutex > aGuard( maMutex ); mbTerminate = false; @@ -296,14 +296,14 @@ ThreadTaskTag::ThreadTaskTag() : mnTasksWorking(0) void ThreadTaskTag::onTaskPushed() { - std::unique_lock< std::mutex > aGuard( maMutex ); + std::scoped_lock< std::mutex > aGuard( maMutex ); mnTasksWorking++; assert( mnTasksWorking < 65536 ); // sanity checking } void ThreadTaskTag::onTaskWorkerDone() { - std::unique_lock< std::mutex > aGuard( maMutex ); + std::scoped_lock< std::mutex > aGuard( maMutex ); mnTasksWorking--; assert(mnTasksWorking >= 0); if (mnTasksWorking == 0) @@ -312,7 +312,7 @@ void ThreadTaskTag::onTaskWorkerDone() bool ThreadTaskTag::isDone() { - std::unique_lock< std::mutex > aGuard( maMutex ); + std::scoped_lock< std::mutex > aGuard( maMutex ); return mnTasksWorking == 0; } |