鎖函數(shù),一般要做const函數(shù)使用,但EnterCriticalSection只接受非const參數(shù),其實(shí)m_CS是非const限定的,但是帶了const的函數(shù),會(huì)將m_CS變成const m_CS來(lái)使用,所以,需要轉(zhuǎn)型即可。
private:
inline void __Lock() const {EnterCriticalSection((CRITICAL_SECTION*)&m_CS);}
inline void __Unlock() const {LeaveCriticalSection((CRITICAL_SECTION*)&m_CS);}