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.

70 lines
2.3 KiB

  1. // Lockable.cpp -- Lockable class implementation
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 1999. This computer program includes Confidential, Proprietary
  4. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  5. // use, disclosure, and/or reproduction is prohibited unless authorized
  6. // in writing. All Rights Reserved.
  7. #include "NoWarning.h"
  8. #include "ForceLib.h"
  9. #include <windows.h>
  10. #include <winbase.h>
  11. #include "Lockable.h"
  12. /////////////////////////// LOCAL/HELPER /////////////////////////////////
  13. /////////////////////////// PUBLIC /////////////////////////////////
  14. // Types
  15. // C'tors/D'tors
  16. Lockable::Lockable()
  17. {
  18. InitializeCriticalSection(&m_CriticalSection);
  19. }
  20. Lockable::~Lockable()
  21. {
  22. DeleteCriticalSection(&m_CriticalSection);
  23. }
  24. // Operators
  25. // Operations
  26. void
  27. Lockable::Lock()
  28. {
  29. EnterCriticalSection(&m_CriticalSection);
  30. }
  31. void
  32. Lockable::Unlock()
  33. {
  34. LeaveCriticalSection(&m_CriticalSection);
  35. }
  36. // Access
  37. // Predicates
  38. // Static Variables
  39. /////////////////////////// PROTECTED /////////////////////////////////
  40. // C'tors/D'tors
  41. // Operators
  42. // Operations
  43. // Access
  44. // Predicates
  45. // Static Variables
  46. /////////////////////////// PRIVATE /////////////////////////////////
  47. // C'tors/D'tors
  48. // Operators
  49. // Operations
  50. // Access
  51. // Predicates
  52. // Static Variables