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

/*++
Copyright (C) 1996-2002 Microsoft Corporation
Module Name:
SYNC.CXX
Abstract:
Synchronization
History:
--*/
#include "..\pch\headers.hxx"
#include "statsync.hxx"
//
//
// Critical Section to be used when it's a Global or class static
//
///////////////////////////////////////////////////
BOOL CStaticCritSec::anyFailed_ = FALSE;
CStaticCritSec::CStaticCritSec(): initialized_(false)
{
initialized_ = (InitializeCriticalSectionAndSpinCount(this,0))?true:false;
if (!initialized_) anyFailed_ = TRUE;
}
CStaticCritSec::~CStaticCritSec()
{
if(initialized_)
DeleteCriticalSection(this);
}
BOOL CStaticCritSec::anyFailure()
{
return anyFailed_;
};