syncobj.cpp
上传用户:tt_chan
上传日期:2009-12-03
资源大小:4523k
文件大小:0k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. #include "stdafx.h"
  2. #include "syncobj.h"
  3. #include "error.h"
  4. CCriticalSection::CCriticalSection()
  5. {
  6. InitializeCriticalSection( &m_csAccess );
  7. }
  8. CCriticalSection::~CCriticalSection()
  9. {
  10. DeleteCriticalSection( &m_csAccess );
  11. }
  12. void CCriticalSection::Lock()
  13. {
  14. EnterCriticalSection( &m_csAccess );
  15. }
  16. void CCriticalSection::Unlock()
  17. {
  18. LeaveCriticalSection( &m_csAccess );
  19. }