misc/libphysfs/lzma/CPP/7zip/Archive/Common/CrossThreadProgress.h
branchui-scaling
changeset 15283 c4fd2813b127
parent 13390 0135e64c6c66
parent 15279 7ab5cf405686
child 15663 d92eeb468dad
equal deleted inserted replaced
13390:0135e64c6c66 15283:c4fd2813b127
     1 // CrossThreadProgress.h
       
     2 
       
     3 #ifndef __CROSSTHREADPROGRESS_H
       
     4 #define __CROSSTHREADPROGRESS_H
       
     5 
       
     6 #include "../../ICoder.h"
       
     7 #include "../../../Windows/Synchronization.h"
       
     8 #include "../../../Common/MyCom.h"
       
     9 
       
    10 class CCrossThreadProgress: 
       
    11   public ICompressProgressInfo,
       
    12   public CMyUnknownImp
       
    13 {
       
    14 public:
       
    15   const UInt64 *InSize;
       
    16   const UInt64 *OutSize;
       
    17   HRESULT Result;
       
    18   NWindows::NSynchronization::CAutoResetEvent ProgressEvent;
       
    19   NWindows::NSynchronization::CAutoResetEvent WaitEvent;
       
    20 
       
    21   HRes Create()
       
    22   {
       
    23     RINOK(ProgressEvent.CreateIfNotCreated());
       
    24     return WaitEvent.CreateIfNotCreated();
       
    25   }
       
    26   void Init()
       
    27   {
       
    28     ProgressEvent.Reset();
       
    29     WaitEvent.Reset();
       
    30   }
       
    31 
       
    32   MY_UNKNOWN_IMP
       
    33 
       
    34   STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
       
    35 };
       
    36 
       
    37 #endif