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.

43 lines
956 B

  1. //============================================================================
  2. //
  3. // CAutoLock.h -- Automatic locking class for mutexes and critical sections.
  4. //
  5. // Copyright (c) 1998-2002 Microsoft Corporation, All Rights Reserved
  6. //
  7. // Revisions: 6/26/98 a-kevhu Created
  8. //
  9. //============================================================================
  10. #ifndef __CAUTOLOCK_H__
  11. #define __CAUTOLOCK_H__
  12. #include "CGlobal.h"
  13. #include "CMutex.h"
  14. #include "CCriticalSec.h"
  15. class CAutoLock
  16. {
  17. private:
  18. //HANDLE m_hMutexHandle;
  19. //CMutex* m_pcMutex;
  20. CCriticalSec* m_pcCritSec;
  21. CStaticCritSec* m_psCritSec;
  22. BOOL bExec ;
  23. //CAutoLock( HANDLE hMutexHandle);
  24. public:
  25. // Constructors
  26. //CAutoLock( CMutex& rCMutex);
  27. CAutoLock( CCriticalSec& rCCriticalSec);
  28. CAutoLock( CStaticCritSec & rCCriticalSec);
  29. // Destructor
  30. ~CAutoLock();
  31. BOOL Exec () ;
  32. };
  33. #endif