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.

46 lines
747 B

  1. /*++
  2. Copyright (C) 1996-2002 Microsoft Corporation
  3. Module Name:
  4. SYNC.CXX
  5. Abstract:
  6. Synchronization
  7. History:
  8. --*/
  9. #include "..\pch\headers.hxx"
  10. #include "statsync.hxx"
  11. //
  12. //
  13. // Critical Section to be used when it's a Global or class static
  14. //
  15. ///////////////////////////////////////////////////
  16. BOOL CStaticCritSec::anyFailed_ = FALSE;
  17. CStaticCritSec::CStaticCritSec(): initialized_(false)
  18. {
  19. initialized_ = (InitializeCriticalSectionAndSpinCount(this,0))?true:false;
  20. if (!initialized_) anyFailed_ = TRUE;
  21. }
  22. CStaticCritSec::~CStaticCritSec()
  23. {
  24. if(initialized_)
  25. DeleteCriticalSection(this);
  26. }
  27. BOOL CStaticCritSec::anyFailure()
  28. {
  29. return anyFailed_;
  30. };