Lock.h 297 B

1234567891011121314151617181920212223242526272829
  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* plock);
  18. ~CAutoLock();
  19. private:
  20. CLock* m_plock;
  21. };
  22. #endif