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.

45 lines
781 B

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: critsec.hxx
  7. //
  8. // Contents: CTakeCriticalSection class
  9. //
  10. // History: 11-Apr-95 BruceFo Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #ifndef __CRITSEC_HXX__
  14. #define __CRITSEC_HXX__
  15. class CTakeCriticalSection
  16. {
  17. public:
  18. CTakeCriticalSection(
  19. IN PCRITICAL_SECTION pcs
  20. )
  21. :
  22. m_pcs(pcs)
  23. {
  24. EnterCriticalSection(m_pcs);
  25. }
  26. ~CTakeCriticalSection()
  27. {
  28. LeaveCriticalSection(m_pcs);
  29. }
  30. private:
  31. //
  32. // Class variables
  33. //
  34. PCRITICAL_SECTION m_pcs;
  35. };
  36. #endif // __CRITSEC_HXX__