?? swmrg.h
字號:
/******************************************************************************
Module: SWMRG.h
Notices: Copyright (c) 2000 Jeffrey Richter
******************************************************************************/
#pragma once
///////////////////////////////////////////////////////////////////////////////
class CSWMRG {
public:
CSWMRG(); // Constructor
~CSWMRG(); // Destructor
VOID WaitToRead(); // Call this to gain shared read access
VOID WaitToWrite(); // Call this to gain exclusive write access
VOID Done(); // Call this when done accessing the resource
private:
CRITICAL_SECTION m_cs; // Permits exclusive access to other members
HANDLE m_hsemReaders; // Readers wait on this if a writer has access
HANDLE m_hsemWriters; // Writers wait on this if a reader has access
int m_nWaitingReaders; // Number of readers waiting for access
int m_nWaitingWriters; // Number of writers waiting for access
int m_nActive; // Number of threads currently with access
// (0=no threads, >0=# of readers, -1=1 writer)
};
//////////////////////////////// End of File //////////////////////////////////
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -