Leaked source code of windows server 2003
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.

40 lines
729 B

  1. //***************************************************************************
  2. //
  3. // Copyright � Microsoft Corporation. All rights reserved.
  4. //
  5. // stllock.h
  6. //
  7. // Purpose: Critical section class
  8. //
  9. //***************************************************************************
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. #ifndef _STLLOCK_H_
  14. #define _STLLOCK_H_
  15. class CCritSec : public CRITICAL_SECTION
  16. {
  17. public:
  18. CCritSec()
  19. {
  20. InitializeCriticalSection(this);
  21. }
  22. ~CCritSec()
  23. {
  24. DeleteCriticalSection(this);
  25. }
  26. void Enter()
  27. {
  28. EnterCriticalSection(this);
  29. }
  30. void Leave()
  31. {
  32. LeaveCriticalSection(this);
  33. }
  34. };
  35. #endif