<br />class TestClass<br />{<br />CCriticalSection m_csTest;<br />void Fun1() <br />{ <br /> m_csTest.Lock();<br /> Fun2();<br /> MessageBox("In Fun1 critical section.");<br /> m_csTest.Unlock();<br />}<br /><br />void Fun2()<br />{<br /> m_csTest.Lock(); <br /> MessageBox("In Fun2 critical section.");<br /> m_csTest.Unlock();<br />}<br />};<br />
Lock
Fun1
Fun2
Unlock
CCriticalSection
EnterCriticalSection
LeaveCriticalSection
var