You have to have the resources to be controlled with Cmutex object. Then within every object trying to access this resource declare the variable that is of the type CsingleLock/CMultiLock. Calling the lock funtion from this access variable. If you cannot get access in some time, then timeout and continue execution or if you got access perform the functions and do the unlock over the lock variable. Now we have a thread-safe access to the specified resource guarded by the mutex.