For purposes of this example this is declared in global memory, known to initialize to all 0.
CRITICALSECTION cs_lock_test;
In some bit of code that can be executed by several threads...
{ EnterCriticalSec( &cs_lock_test ); // the code in here will only be run by a single thread LeaveCriticalSec( &cs_lock_test ); }