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.

24 lines
463 B

  1. #ifndef __CRITSEC_H__
  2. #define __CRITSEC_H__
  3. //
  4. // CRITSEC.H: Wrapper class for critical sections
  5. //
  6. //
  7. class CCriticalSection
  8. {
  9. public:
  10. // Constructor/Destructor
  11. CCriticalSection() { InitializeCriticalSection(&m_CriticalSection); }
  12. ~CCriticalSection() { DeleteCriticalSection(&m_CriticalSection); }
  13. protected:
  14. CRITICAL_SECTION m_CriticalSection;
  15. public:
  16. inline operator CRITICAL_SECTION*() { return &m_CriticalSection; }
  17. };
  18. #endif