// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#include "Precompiled.h"
#include "SharedIncludes.h"
namespace RuntimeForStatic {
//==================================================================================================

bool $CS::Initialize(CRITICAL_SECTION& criticalSection $out)
{
   __try { // STATUS_NO_MEMORY exception:
      ::InitializeCriticalSection( &criticalSection ); }
   __except( EXCEPTION_EXECUTE_HANDLER ) {
      return $LE::SetWin32FuncFailure($, L"InitializeCriticalSection" ); }
   return $SUCCEED_LE();
}
void $CS::Delete(CRITICAL_SECTION& criticalSection)
{
   ::DeleteCriticalSection( &criticalSection );
}

//--------------------------------------------------------------------------------------------------

void $CS::Enter(CRITICAL_SECTION& criticalSection)
{
   ::EnterCriticalSection( &criticalSection );
}
void $CS::Leave(CRITICAL_SECTION& criticalSection)
{
   ::LeaveCriticalSection( &criticalSection );
}

//==================================================================================================
} // RuntimeForStatic
