diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2007-05-25 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:51 +0300 |
commit | c574fc0f4bba94e693b0e22f730d355b75d4f4ce (patch) | |
tree | da4ebd90c776d508ac679d50492f29461db80be0 /CPP/7zip/Archive/Common/CoderMixer2MT.h | |
parent | a145bfc7cf17f7bbcfae8f0064333c8ea75b455c (diff) |
4.46 beta
Diffstat (limited to 'CPP/7zip/Archive/Common/CoderMixer2MT.h')
-rwxr-xr-x | CPP/7zip/Archive/Common/CoderMixer2MT.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/CPP/7zip/Archive/Common/CoderMixer2MT.h b/CPP/7zip/Archive/Common/CoderMixer2MT.h index 78d752de..67c0c8a5 100755 --- a/CPP/7zip/Archive/Common/CoderMixer2MT.h +++ b/CPP/7zip/Archive/Common/CoderMixer2MT.h @@ -20,9 +20,9 @@ namespace NCoderMixer2 { struct CThreadCoderInfo: public CCoderInfo { - NWindows::NSynchronization::CAutoResetEvent *CompressEvent; + NWindows::NSynchronization::CAutoResetEvent CompressEvent; HANDLE ExitEvent; - NWindows::NSynchronization::CAutoResetEvent *CompressionCompletedEvent; + NWindows::NSynchronization::CAutoResetEvent CompressionCompletedEvent; CObjectVector< CMyComPtr<ISequentialInStream> > InStreams; CObjectVector< CMyComPtr<ISequentialOutStream> > OutStreams; @@ -35,9 +35,12 @@ struct CThreadCoderInfo: public CCoderInfo CThreadCoderInfo(UInt32 numInStreams, UInt32 numOutStreams); void SetCoderInfo(const UInt64 **inSizes, const UInt64 **outSizes, ICompressProgressInfo *progress); - ~CThreadCoderInfo(); bool WaitAndCode(); - void CreateEvents(); + HRes CreateEvents() + { + RINOK(CompressEvent.CreateIfNotCreated()); + return CompressionCompletedEvent.CreateIfNotCreated(); + } }; @@ -105,14 +108,20 @@ private: NWindows::CThread _mainThread; NWindows::NSynchronization::CAutoResetEvent _startCompressingEvent; - CRecordVector<HANDLE> _compressingCompletedEvents; NWindows::NSynchronization::CAutoResetEvent _compressingFinishedEvent; NWindows::NSynchronization::CManualResetEvent _exitEvent; UInt32 _progressCoderIndex; + HRes CreateEvents() + { + RINOK(_startCompressingEvent.CreateIfNotCreated()); + RINOK(_compressingFinishedEvent.CreateIfNotCreated()); + return _exitEvent.CreateIfNotCreated(); + } + public: - void SetBindInfo(const CBindInfo &bindInfo); + HRESULT SetBindInfo(const CBindInfo &bindInfo); }; |