Lock.h 299 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __LOCK_H_
  2. #define __LOCK_H_
  3. /*-----------------ÁÙ½çÇø-----------------*/
  4. class CLock
  5. {
  6. public:
  7. CLock();
  8. ~CLock();
  9. void lock();
  10. void unlock();
  11. private:
  12. CRITICAL_SECTION cs;
  13. };
  14. class CAutoLock
  15. {
  16. public:
  17. CAutoLock(CLock* m_lock);
  18. ~CAutoLock();
  19. private:
  20. CLock* m_plock;
  21. };
  22. #endif