summaryrefslogtreecommitdiff
path: root/package/inc
diff options
context:
space:
mode:
Diffstat (limited to 'package/inc')
-rw-r--r--package/inc/ZipOutputEntry.hxx10
-rw-r--r--package/inc/ZipOutputStream.hxx10
2 files changed, 19 insertions, 1 deletions
diff --git a/package/inc/ZipOutputEntry.hxx b/package/inc/ZipOutputEntry.hxx
index 450cc39b9bc8..cac0c2ffa584 100644
--- a/package/inc/ZipOutputEntry.hxx
+++ b/package/inc/ZipOutputEntry.hxx
@@ -28,6 +28,7 @@
#include <package/Deflater.hxx>
#include <CRC32.hxx>
+#include <atomic>
struct ZipEntry;
class ZipPackageBuffer;
@@ -35,6 +36,9 @@ class ZipPackageStream;
class ZipOutputEntry
{
+ // allow only DeflateThread to change m_bFinished using setFinished()
+ friend class DeflateThread;
+
css::uno::Sequence< sal_Int8 > m_aDeflateBuffer;
ZipUtils::Deflater m_aDeflater;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
@@ -48,8 +52,9 @@ class ZipOutputEntry
CRC32 m_aCRC;
ZipEntry *m_pCurrentEntry;
sal_Int16 m_nDigested;
- bool m_bEncryptCurrentEntry;
ZipPackageStream* m_pCurrentStream;
+ bool m_bEncryptCurrentEntry;
+ std::atomic<bool> m_bFinished;
public:
ZipOutputEntry(
@@ -78,7 +83,10 @@ public:
void closeEntry();
void write(const css::uno::Sequence< sal_Int8 >& rBuffer);
+ bool isFinished() const { return m_bFinished; }
+
private:
+ void setFinished() { m_bFinished = true; }
void doDeflate();
};
diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx
index 16740095bd92..f995469b29e6 100644
--- a/package/inc/ZipOutputStream.hxx
+++ b/package/inc/ZipOutputStream.hxx
@@ -69,6 +69,16 @@ private:
throw(css::io::IOException, css::uno::RuntimeException);
void writeEXT( const ZipEntry &rEntry )
throw(css::io::IOException, css::uno::RuntimeException);
+
+ // ScheduledThread handling helpers
+ void consumeScheduledThreadEntry(ZipOutputEntry* pCandidate);
+ void consumeFinishedScheduledThreadEntries();
+ void consumeAllScheduledThreadEntries();
+
+public:
+ void reduceScheduledThreadsToGivenNumberOrLess(
+ sal_Int32 nThreads,
+ sal_Int32 nWaitTimeInTenthSeconds);
};
#endif