home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / stllock.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  799 b   |  43 lines

  1. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  2. //***************************************************************************
  3. //
  4. //  Copyright (c) 1997-1999 Microsoft Corporation
  5. //
  6. //  stllock.h
  7. //
  8. //  Purpose: Critical section class
  9. //
  10. //***************************************************************************
  11.  
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15.  
  16. #ifndef _STLLOCK_H_
  17. #define _STLLOCK_H_
  18.  
  19. class CCritSec : public CRITICAL_SECTION
  20. {
  21. public:
  22.     CCritSec() 
  23.     {
  24.         InitializeCriticalSection(this);
  25.     }
  26.     ~CCritSec()
  27.     {
  28.         DeleteCriticalSection(this);
  29.     }
  30.     void Enter()
  31.     {
  32.         EnterCriticalSection(this);
  33.     }
  34.     void Leave()
  35.     {
  36.         LeaveCriticalSection(this);
  37.     }
  38. };
  39.  
  40. #endif
  41.  
  42. #pragma option pop /*P_O_Pop*/
  43.