From aeb2014ba401707dece5d0cf3cb213ce307a5330 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 21 May 2019 12:41:44 +0200 Subject: remove code confusion about threads vs thread tasks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A threadpool controls a number of threads that execute a number of thread *tasks* from a queue. The API even says they are tasks. So it's damn confusing when ZipPackageStream::saveChild() claims to limit the number of threads to 4x the maximum number of threads. It limits the number of queued thread tasks. Change-Id: I317497f27a82d92a7c8566b14aaeae73a4ffef1f Reviewed-on: https://gerrit.libreoffice.org/72677 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- package/inc/ZipOutputEntry.hxx | 4 ++-- package/inc/ZipOutputStream.hxx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'package/inc') diff --git a/package/inc/ZipOutputEntry.hxx b/package/inc/ZipOutputEntry.hxx index 15c94aecc14b..c35da5818062 100644 --- a/package/inc/ZipOutputEntry.hxx +++ b/package/inc/ZipOutputEntry.hxx @@ -36,8 +36,8 @@ class ZipPackageStream; class ZipOutputEntry { - // allow only DeflateThread to change m_bFinished using setFinished() - friend class DeflateThread; + // allow only DeflateThreadTask to change m_bFinished using setFinished() + friend class DeflateThreadTask; css::uno::Sequence< sal_Int8 > m_aDeflateBuffer; ZipUtils::Deflater m_aDeflater; diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx index 814413da041e..ff7b66d64507 100644 --- a/package/inc/ZipOutputStream.hxx +++ b/package/inc/ZipOutputStream.hxx @@ -47,7 +47,7 @@ public: const css::uno::Reference< css::io::XOutputStream > &xOStream ); ~ZipOutputStream(); - void addDeflatingThread( ZipOutputEntry *pEntry, std::unique_ptr pThreadTask ); + void addDeflatingThreadTask( ZipOutputEntry *pEntry, std::unique_ptr pThreadTask ); /// @throws css::io::IOException /// @throws css::uno::RuntimeException @@ -79,12 +79,12 @@ private: void writeEXT( const ZipEntry &rEntry ); // ScheduledThread handling helpers - void consumeScheduledThreadEntry(std::unique_ptr pCandidate); - void consumeFinishedScheduledThreadEntries(); + void consumeScheduledThreadTaskEntry(std::unique_ptr pCandidate); + void consumeFinishedScheduledThreadTaskEntries(); public: - void reduceScheduledThreadsToGivenNumberOrLess( - sal_Int32 nThreads); + void reduceScheduledThreadTasksToGivenNumberOrLess( + sal_Int32 nThreadTasks); const std::shared_ptr& getThreadTaskTag() { return mpThreadTaskTag; } }; -- cgit