summaryrefslogtreecommitdiff
path: root/package/inc/ZipOutputStream.hxx
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-10-21 15:17:13 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-11-17 10:49:23 +0100
commitfbf714b45625c50bb1c736ef231b5dbbab0016a1 (patch)
tree0e1a9e9002a8ce8ca46d7a7071f40c08ffea77e4 /package/inc/ZipOutputStream.hxx
parentdb5552631b13e5a1d330929cd5093bd0f9894ec8 (diff)
package: Finally implement parallel zip entries deflating
For that: 1, create ZipPackageStream::successfullyWritten to be called after the content is written 2, Do not take mutex when reading from WrapStreamForShare - threads should be using different streams anyway, but there is only one common mutex. :-/ Change-Id: I90303e49206b19454dd4141e24cc8be29c433045
Diffstat (limited to 'package/inc/ZipOutputStream.hxx')
-rw-r--r--package/inc/ZipOutputStream.hxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx
index f11b8833d146..4e8e4ff150be 100644
--- a/package/inc/ZipOutputStream.hxx
+++ b/package/inc/ZipOutputStream.hxx
@@ -23,10 +23,12 @@
#include <com/sun/star/io/XOutputStream.hpp>
#include <ByteChucker.hxx>
+#include <comphelper/threadpool.hxx>
#include <vector>
struct ZipEntry;
+class ZipOutputEntry;
class ZipPackageStream;
class ZipOutputStream
@@ -35,14 +37,17 @@ class ZipOutputStream
::std::vector < ZipEntry * > m_aZipList;
ByteChucker m_aChucker;
- bool m_bFinished;
ZipEntry *m_pCurrentEntry;
+ comphelper::ThreadPool &m_rSharedThreadPool;
+ std::vector< ZipOutputEntry* > m_aEntries;
public:
ZipOutputStream(
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > &xOStream );
~ZipOutputStream();
+ void addDeflatingThread( ZipOutputEntry *pEntry, comphelper::ThreadTask *pThreadTask );
+
void writeLOC( ZipEntry *pEntry, bool bEncrypt = false )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
void rawWrite( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )