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