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.

36 lines
756 B

  1. // ReadWriteLock.h: interface for the CReadWriteLock class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #pragma once
  5. class CReadWriteLock
  6. {
  7. public:
  8. BOOL Initialize();
  9. void Deinitialize();
  10. void EnterWriteLock();
  11. void EnterReadLock();
  12. void LeaveLock();
  13. private:
  14. BOOL m_fCritSecInited;
  15. #ifdef DPNBUILD_ONLYONETHREAD
  16. #ifdef DBG
  17. // Used to ensure that no one re-enters
  18. DWORD m_dwThreadID;
  19. #endif // DBG
  20. #else // ! DPNBUILD_ONLYONETHREAD
  21. LONG m_lWriterCount;
  22. LONG m_lReaderCount;
  23. BOOL m_fWriterMode;
  24. DNCRITICAL_SECTION m_csWrite;
  25. #ifdef DBG
  26. // Used to ensure that no one re-enters
  27. DWORD m_dwWriteThread;
  28. #endif // DBG
  29. #endif // ! DPNBUILD_ONLYONETHREAD
  30. };