CMutex::CMutex

CMutex( BOOL bInitiallyOwn = FALSE, LPCTSTR lpszName = NULL, LPSECURITY_ATTRIBUTES lpsaAttribute = NULL );

Parameters

bInitiallyOwn

Specifies if the thread creating the CMutex object initially has access to the resource controlled by the mutex.

lpszName

Name of the CMutex object. If another mutex with the same name exists, lpszName must be supplied if the object will be used across process boundaries. If NULL, the mutex will be unnamed. If the name matches an existing mutex, the constructor builds a new CMutex object which references the mutex of that name. If the name matches an existing synchronization object that is not a mutex, the construction will fail.

lpsaAttribute

Security attributes for the mutex object. For a full description of this structure, see SECURITY_ATTRIBUTES in the Win32 Programmer’s Reference.

Remarks

Constructs a named or unnamed CMutex object. To access or release a CMutex object, create a CMultiLock or CSingleLock object and call its Lock and Unlock member functions. If the CMutex object is being used stand-alone, call its Unlock member function to release it.

CMutex OverviewClass MembersHierarchy Chart