CMutex is a synchronization
class which uses synchronization object named as mutex. It allows
multiple program thread can share the same resource by taking turns. At the
starting of the program it creates a mutex at beginning and then a system gives
a unique ID or name for it. After that, any thread which needs the resource can
use the mutex to lock the resource.
For example; access of a file. To use CMutex, construct its
object when it is needed to be accessed. Give the name of mutex and to the
application will own it. You can access mutex when constructor returns again to
the start. When you have done, accessing the controlled resource then call CSyncObject::Unlock.
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.
CMutex is a synchronization class which uses synchronization object named as mutex. It allows multiple program thread can share the same resource by taking turns. At the starting of the program it creates a mutex at beginning and then a system gives a unique ID or name for it. After that, any thread which needs the resource can use the mutex to lock the resource.
For example; access of a file. To use CMutex, construct its object when it is needed to be accessed. Give the name of mutex and to the application will own it. You can access mutex when constructor returns again to the start. When you have done, accessing the controlled resource then call CSyncObject::Unlock.