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
2.2 KiB

  1. // Lockable.h -- Lockable class definition
  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. #if !defined(SLBCSP_LOCKABLE_H)
  8. #define SLBCSP_LOCKABLE_H
  9. #include <windows.h>
  10. // Abstract base class mixin for use by derived classes that must
  11. // maintain a lock (using a critical section).
  12. class Lockable
  13. {
  14. public:
  15. // Types
  16. // C'tors/D'tors
  17. Lockable();
  18. virtual
  19. ~Lockable();
  20. // Operators
  21. // Operations
  22. virtual void
  23. Lock();
  24. virtual void
  25. Unlock();
  26. // Access
  27. // Predicates
  28. protected:
  29. // Types
  30. // C'tors/D'tors
  31. // Operators
  32. // Operations
  33. // Access
  34. // Predicates
  35. // Variables
  36. private:
  37. // Types
  38. // C'tors/D'tors
  39. Lockable(Lockable const &rhs); // not defined, copying not allowed
  40. // Operators
  41. Lockable &
  42. operator=(Lockable const &rhs); // not defined, assignment not allowed
  43. // Operations
  44. // Access
  45. // Predicates
  46. // Variables
  47. CRITICAL_SECTION m_CriticalSection;
  48. };
  49. #endif // SLBCSP_LOCKABLE_H