critsec.h 386 B

1234567891011121314
  1. #ifndef _PFC_CRITSEC_H_
  2. #define _PFC_CRITSEC_H_
  3. class critical_section : public CRITICAL_SECTION
  4. {
  5. public:
  6. inline void enter() {EnterCriticalSection(this);}
  7. inline void leave() {LeaveCriticalSection(this);}
  8. critical_section() {InitializeCriticalSection(this);}
  9. ~critical_section() {DeleteCriticalSection(this);}
  10. //BOOL TryEnter() {return TryEnterCriticalSection(this);}
  11. };
  12. #endif