Description: First of all, in the main thread InitializeCriticalSection () to initialize the critical partition. Then create two sub-threads, in two sub-thread count of global variables, respectively, using the EnterCriticalSection () to enter the critical section, and LeaveCriticalSection () to exit the critical section. The two sub-thread has finished running, the main thread to use DeleteCriticalSection () to delete the critical section and revoke the thread.
To Search:
File list (Check if you may need any files):
Mutex\Debug\Mutex.exe
.....\.....\Mutex.ilk
.....\.....\Mutex.pdb
.....\Mutex\Mutex.cpp
.....\.....\Mutex.h
.....\.....\Mutex.rc
.....\.....\Mutex.vcxproj
.....\.....\Mutex.vcxproj.filters
.....\.....\Mutex.vcxproj.user
.....\.....\ReadMe.txt
.....\.....\Resource.h
.....\.....\stdafx.cpp
.....\.....\stdafx.h
.....\.....\targetver.h
.....\Mutex.sln
.....\Mutex.suo
.....\ipch\mutex-720a10c3
.....\Debug
.....\ipch
.....\Mutex
Mutex