ThreadManager.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright (c) Microsoft Corporation. All rights reserved
  7. #ifndef _THREADMANAGER_H_
  8. #define _THREADMANAGER_H_
  9. #include "CommonTypes.h"
  10. class THREADMANAGER
  11. {
  12. public:
  13. THREADMANAGER();
  14. ~THREADMANAGER();
  15. void Clean();
  16. DUPL_RETURN Initialize(INT SingleOutput, UINT OutputCount, HANDLE UnexpectedErrorEvent, HANDLE ExpectedErrorEvent, HANDLE TerminateThreadsEvent, HANDLE SharedHandle, _In_ const struct tmedia_producer_s* Producer, _In_ RECT* DesktopDim);
  17. PTR_INFO* GetPointerInfo();
  18. bool WaitForThreadTermination(DWORD timeout = INFINITE);
  19. private:
  20. DUPL_RETURN InitializeDx(_Out_ DX_RESOURCES* Data);
  21. void CleanDx(_Inout_ DX_RESOURCES* Data);
  22. PTR_INFO m_PtrInfo;
  23. UINT m_ThreadCount;
  24. _Field_size_(m_ThreadCount) HANDLE* m_ThreadHandles;
  25. _Field_size_(m_ThreadCount) THREAD_DATA* m_ThreadData;
  26. };
  27. #endif