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.

22 lines
293 B

  1. #ifndef PASSPORTGUARD_HPP
  2. #define PASSPORTGUARD_HPP
  3. template <class Lock>
  4. class PassportGuard
  5. {
  6. public:
  7. PassportGuard(Lock& lock)
  8. :mLock(lock)
  9. {
  10. mLock.acquire();
  11. }
  12. ~PassportGuard()
  13. {
  14. mLock.release();
  15. }
  16. private:
  17. Lock& mLock;
  18. };
  19. #endif //!PASSPORTGUARD_HPP