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.

35 lines
907 B

  1. #include <pch.cpp>
  2. #pragma hdrstop
  3. #include "rwlock.h"
  4. using namespace CertSrv;
  5. /////////////////////////////////////////////////////////////////////////////
  6. CReadWriteLock::CReadWriteLock()
  7. {
  8. RtlInitializeResource(&m_RtlLock);
  9. }
  10. /////////////////////////////////////////////////////////////////////////////
  11. CReadWriteLock::~CReadWriteLock()
  12. {
  13. RtlDeleteResource(&m_RtlLock);
  14. }
  15. /////////////////////////////////////////////////////////////////////////////
  16. void CReadWriteLock::GetExclusive()
  17. {
  18. RtlAcquireResourceExclusive(&m_RtlLock, TRUE);
  19. }
  20. /////////////////////////////////////////////////////////////////////////////
  21. void CReadWriteLock::GetShared()
  22. {
  23. RtlAcquireResourceShared(&m_RtlLock, TRUE);
  24. }
  25. /////////////////////////////////////////////////////////////////////////////
  26. void CReadWriteLock::Release()
  27. {
  28. RtlReleaseResource(&m_RtlLock);
  29. }