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.

47 lines
952 B

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. bsconcur.cxx
  5. Abstract:
  6. Implementation of CBsXXXX classes that wrap Win32 concurrency controls.
  7. Author:
  8. Stefan R. Steiner [SSteiner] 11-Apr-1998
  9. Revision History:
  10. --*/
  11. #include <windows.h>
  12. #include "bsconcur.hxx"
  13. //////////////////////////////////////////////////////////////////////
  14. // CBsAutoLock class implementation
  15. //////////////////////////////////////////////////////////////////////
  16. CBsAutoLock::~CBsAutoLock()
  17. {
  18. BOOL bStatus = TRUE;
  19. switch( m_type ) {
  20. case BS_AUTO_MUTEX_HANDLE:
  21. bStatus = ::ReleaseMutex( m_hMutexHandle );
  22. break;
  23. case BS_AUTO_CRIT_SEC:
  24. ::LeaveCriticalSection( m_pCritSec );
  25. break;
  26. case BS_AUTO_CRIT_SEC_CLASS:
  27. m_pcCritSec->Leave();
  28. break;
  29. }
  30. if ( bStatus == FALSE ) {
  31. throw( ::GetLastError() );
  32. }
  33. }