mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-11 08:07:12 -06:00
Remove _hMutex from ZstdEncoder.cpp
This commit is contained in:
@@ -39,7 +39,6 @@ CEncoder::CEncoder():
|
|||||||
_LdmHashRateLog(-1)
|
_LdmHashRateLog(-1)
|
||||||
{
|
{
|
||||||
_props.clear();
|
_props.clear();
|
||||||
_hMutex = CreateMutex(NULL, FALSE, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CEncoder::~CEncoder()
|
CEncoder::~CEncoder()
|
||||||
@@ -48,7 +47,6 @@ CEncoder::~CEncoder()
|
|||||||
ZSTD_freeCCtx(_ctx);
|
ZSTD_freeCCtx(_ctx);
|
||||||
MyFree(_srcBuf);
|
MyFree(_srcBuf);
|
||||||
MyFree(_dstBuf);
|
MyFree(_dstBuf);
|
||||||
CloseHandle(_hMutex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,9 +331,7 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
|
|||||||
ZSTD_todo = ZSTD_e_end;
|
ZSTD_todo = ZSTD_e_end;
|
||||||
|
|
||||||
/* compress data */
|
/* compress data */
|
||||||
WaitForSingleObject(_hMutex, INFINITE);
|
|
||||||
_processedIn += srcSize;
|
_processedIn += srcSize;
|
||||||
ReleaseMutex(_hMutex);
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
outBuff.dst = _dstBuf;
|
outBuff.dst = _dstBuf;
|
||||||
@@ -369,10 +365,8 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
|
|||||||
/* write output */
|
/* write output */
|
||||||
if (outBuff.pos) {
|
if (outBuff.pos) {
|
||||||
RINOK(WriteStream(outStream, _dstBuf, outBuff.pos));
|
RINOK(WriteStream(outStream, _dstBuf, outBuff.pos));
|
||||||
WaitForSingleObject(_hMutex, INFINITE);
|
|
||||||
_processedOut += outBuff.pos;
|
_processedOut += outBuff.pos;
|
||||||
RINOK(progress->SetRatioInfo(&_processedIn, &_processedOut));
|
RINOK(progress->SetRatioInfo(&_processedIn, &_processedOut));
|
||||||
ReleaseMutex(_hMutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* done */
|
/* done */
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ class CEncoder:
|
|||||||
UInt64 _processedIn;
|
UInt64 _processedIn;
|
||||||
UInt64 _processedOut;
|
UInt64 _processedOut;
|
||||||
UInt32 _numThreads;
|
UInt32 _numThreads;
|
||||||
HANDLE _hMutex;
|
|
||||||
|
|
||||||
/* zstd advanced compression options */
|
/* zstd advanced compression options */
|
||||||
Int32 _Long;
|
Int32 _Long;
|
||||||
|
|||||||
Reference in New Issue
Block a user