Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.2 KiB

  1. /*++
  2. Copyright (C) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. History:
  6. --*/
  7. //////////////////////////////////////////////////////////////////////
  8. //
  9. // StressOps.h
  10. //
  11. //////////////////////////////////////////////////////////////////////
  12. #ifndef _STRESSOPS_H_
  13. #define _STRESSOPS_H_
  14. class CBasicRefreshAgent
  15. {
  16. public:
  17. CRefresher *m_pRef; // The refresher to stress
  18. DWORD m_dwIterations; // Total number of cycles
  19. DWORD m_dwPeriod; // Wait between cycles
  20. HANDLE m_hThread; // Stress thread
  21. HANDLE m_hRefreshEvent;
  22. BOOL m_bInfinite;
  23. static DWORD WINAPI StressThreadEntry(LPVOID lpParameter);
  24. virtual void StressLoop();
  25. public:
  26. CBasicRefreshAgent();
  27. virtual ~CBasicRefreshAgent();
  28. BOOL Create(CRefresher *pRef, DWORD dwIterations, DWORD dwPeriod, HANDLE hRefreshEvent);
  29. void BeginStress();
  30. };
  31. #define MAX_INST 100
  32. #define MIN_INST 50
  33. class CRandomOpRefreshAgent : public CBasicRefreshAgent
  34. {
  35. HANDLE m_hThreadAddRefs;
  36. HANDLE m_hThreadRemoveRefs;
  37. virtual void StressLoop();
  38. static DWORD WINAPI AddRefThreadEntry(LPVOID lpParameter);
  39. static DWORD WINAPI RemRefThreadEntry(LPVOID lpParameter);
  40. public:
  41. BOOL Create(CRefresher *pRef, DWORD dwPeriod);
  42. void BeginStress();
  43. };
  44. #endif // _STRESSOPS_H_