diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-08 14:29:53 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-07-18 06:49:09 +0000 |
commit | 76ad32bec8e2c00c21247041b16d9e09e73d2504 (patch) | |
tree | 7b2b1277151bc7904ff63684ebd7e3d6d8a7d661 /package/source/zippackage | |
parent | 9bf9f88e4c7e0b182ec6d8b4aefb7d735bb0653b (diff) |
add tagging to ThreadTasks so we don't need more one pool
If more than one place in the code submits tasks to the shared
pool, then waitTillDone() becomes unreliable.
Add a tagging mechanism, so different callsites can wait
on different sets of tasks.
Also try to protect our worker threads against exceptions from
the thread tasks code.
Change-Id: Idde664ab50008d31a2dd73910bb22f50e62ae22f
Reviewed-on: https://gerrit.libreoffice.org/27042
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'package/source/zippackage')
-rw-r--r-- | package/source/zippackage/ZipPackageStream.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 5efb145fd9f7..e72c3999c9f5 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -466,9 +466,10 @@ class DeflateThread: public comphelper::ThreadTask uno::Reference< io::XInputStream > mxInStream; public: - DeflateThread( ZipOutputEntry *pEntry, + DeflateThread( const std::shared_ptr<comphelper::ThreadTaskTag>& pTag, ZipOutputEntry *pEntry, const uno::Reference< io::XInputStream >& xInStream ) - : mpEntry(pEntry) + : comphelper::ThreadTask(pTag) + , mpEntry(pEntry) , mxInStream(xInStream) {} @@ -849,7 +850,7 @@ bool ZipPackageStream::saveChild( // Start a new thread deflating this zip entry ZipOutputEntry *pZipEntry = new ZipOutputEntry( m_xContext, *pTempEntry, this, bToBeEncrypted); - rZipOut.addDeflatingThread( pZipEntry, new DeflateThread(pZipEntry, xStream) ); + rZipOut.addDeflatingThread( pZipEntry, new DeflateThread(rZipOut.getThreadTaskTag(), pZipEntry, xStream) ); } else { |