Source code of Windows XP (NT5)
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.

45 lines
624 B

  1. #include "stdafx.h"
  2. CRITICAL_SECTION g_STLCs;
  3. BOOL g_STLCsInitialized = FALSE;
  4. bool InitCompilerLibrary()
  5. {
  6. if ( !InitializeCriticalSectionAndSpinCount( &g_STLCs, 0x80000000 ) )
  7. return false;
  8. g_STLCsInitialized = TRUE;
  9. return true;
  10. }
  11. bool UninitCompilerLibrary()
  12. {
  13. if ( g_STLCsInitialized )
  14. {
  15. DeleteCriticalSection( &g_STLCs );
  16. g_STLCsInitialized = FALSE;
  17. }
  18. return true;
  19. }
  20. #if 1
  21. #pragma warning( disable : 4273 )
  22. std::_Lockit::_Lockit()
  23. {
  24. EnterCriticalSection(&g_STLCs);
  25. }
  26. std::_Lockit::~_Lockit()
  27. {
  28. LeaveCriticalSection(&g_STLCs);
  29. }
  30. #endif