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 function 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.
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
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 function 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.