C++では、ふつー、
int somefunc()
{
CCriticalSection guard(&Module.CriticalSection);
 if( a ) return 0;
....
}
とかにすると思うけど……