This commit is contained in:
Igor Pavlov
2021-07-22 23:00:14 +01:00
committed by Kornel
parent 4a960640a3
commit 585698650f
619 changed files with 34904 additions and 10859 deletions

View File

@@ -17,8 +17,8 @@ class COutMemStream:
bool _realStreamMode;
bool _unlockEventWasSent;
NWindows::NSynchronization::CAutoResetEvent StopWritingEvent;
NWindows::NSynchronization::CAutoResetEvent WriteToRealStreamEvent;
NWindows::NSynchronization::CAutoResetEvent_WFMO StopWritingEvent;
NWindows::NSynchronization::CAutoResetEvent_WFMO WriteToRealStreamEvent;
// NWindows::NSynchronization::CAutoResetEvent NoLockEvent;
HRESULT StopWriteResult;
@@ -31,10 +31,13 @@ class COutMemStream:
public:
HRes CreateEvents()
HRes CreateEvents(SYNC_PARAM_DECL(synchro))
{
RINOK(StopWritingEvent.CreateIfNotCreated());
return WriteToRealStreamEvent.CreateIfNotCreated();
WRes wres = StopWritingEvent.CreateIfNotCreated_Reset(SYNC_WFMO(synchro));
if (wres == 0)
wres = WriteToRealStreamEvent.CreateIfNotCreated_Reset(SYNC_WFMO(synchro));
return HRESULT_FROM_WIN32(wres);
}
void SetOutStream(IOutStream *outStream)
@@ -55,7 +58,16 @@ public:
OutSeqStream.Release();
}
COutMemStream(CMemBlockManagerMt *memManager): _memManager(memManager) { }
COutMemStream(CMemBlockManagerMt *memManager):
_memManager(memManager)
{
/*
#ifndef _WIN32
StopWritingEvent._sync =
WriteToRealStreamEvent._sync = &memManager->Synchro;
#endif
*/
}
~COutMemStream() { Free(); }
void Free();