This method calls the Win32 function EnterCriticalSection, which waits until the thread can take ownership of the critical section object contained in the m_sec data member. The critical section object must first be initialized with a call to the Init method. When the protected code has finished executing, the thread must call Unlock to release ownership of the critical section.
void Lock( );
Header file: | Atlwin.h |
Platforms: | |
Versions: | Version 2.0 and later |
Complete documentation: | Visual C++ documentation |
CComCriticalSection Overveiw, CComCriticalSection Methods, CComCriticalSection::Init, CComCriticalSection::Unlock, CComCriticalSection::m_sec, EnterCriticalSection