ReactOS 0.4.15-dev-7674-gc0b4db1
ATL::CMutex Class Reference

#include <atlsync.h>

Inheritance diagram for ATL::CMutex:
Collaboration diagram for ATL::CMutex:

Private Member Functions

 CMutex ()
 
 CMutex (CMutex &hMutex)
 
 CMutex (BOOL bInitialOwner)
 
 CMutex (LPSECURITY_ATTRIBUTES pSecurity, BOOL bInitialOwner, LPCTSTR pszName)
 
 CMutex (HANDLE hMutex)
 
BOOL Create (LPSECURITY_ATTRIBUTES pSecurity, BOOL bInitialOwner, LPCTSTR pszName)
 
BOOL Open (DWORD dwAccess, BOOL bInheritHandle, LPCTSTR pszName)
 
BOOL Release ()
 

Additional Inherited Members

- Public Member Functions inherited from ATL::CHandle
 CHandle ()
 
 CHandle (_Inout_ CHandle &handle)
 
 CHandle (_In_ HANDLE handle)
 
 ~CHandle ()
 
CHandleoperator= (_Inout_ CHandle &handle)
 
 operator HANDLE () const
 
void Attach (_In_ HANDLE handle)
 
HANDLE Detach ()
 
void Close ()
 
- Public Attributes inherited from ATL::CHandle
HANDLE m_handle
 

Detailed Description

Definition at line 105 of file atlsync.h.

Constructor & Destructor Documentation

◆ CMutex() [1/5]

ATL::CMutex::CMutex ( )
inlineprivate

Definition at line 107 of file atlsync.h.

108 {
109 }

◆ CMutex() [2/5]

ATL::CMutex::CMutex ( CMutex hMutex)
inlineprivate

Definition at line 111 of file atlsync.h.

111 : CHandle(hMutex)
112 {
113 }
HANDLE hMutex
Definition: mutex.c:11

◆ CMutex() [3/5]

ATL::CMutex::CMutex ( BOOL  bInitialOwner)
inlineexplicitprivate

Definition at line 115 of file atlsync.h.

116 {
117 Create(NULL, bInitialOwner, NULL);
118 }
@ Create
Definition: registry.c:563
#define NULL
Definition: types.h:112

◆ CMutex() [4/5]

ATL::CMutex::CMutex ( LPSECURITY_ATTRIBUTES  pSecurity,
BOOL  bInitialOwner,
LPCTSTR  pszName 
)
inlineprivate

Definition at line 120 of file atlsync.h.

121 {
122 Create(pSecurity, bInitialOwner, pszName);
123 }

◆ CMutex() [5/5]

ATL::CMutex::CMutex ( HANDLE  hMutex)
inlineexplicitprivate

Definition at line 125 of file atlsync.h.

125 : CHandle(hMutex)
126 {
127 }

Member Function Documentation

◆ Create()

BOOL ATL::CMutex::Create ( LPSECURITY_ATTRIBUTES  pSecurity,
BOOL  bInitialOwner,
LPCTSTR  pszName 
)
inlineprivate

Definition at line 129 of file atlsync.h.

130 {
131 HANDLE hMutex = ::CreateMutex(pSecurity, bInitialOwner, pszName);
133 Attach(hMutex);
134 return hMutex != NULL;
135 }
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
void Attach(_In_ HANDLE handle)
Definition: atlbase.h:350
#define CreateMutex
Definition: winbase.h:3691

◆ Open()

BOOL ATL::CMutex::Open ( DWORD  dwAccess,
BOOL  bInheritHandle,
LPCTSTR  pszName 
)
inlineprivate

Definition at line 137 of file atlsync.h.

138 {
139 HANDLE hMutex = ::OpenMutex(dwAccess, bInheritHandle, pszName);
141 Attach(hMutex);
142 return hMutex != NULL;
143 }
static BOOL bInheritHandle
Definition: pipe.c:82
#define OpenMutex
Definition: winbase.h:3823

◆ Release()

BOOL ATL::CMutex::Release ( )
inlineprivate

Definition at line 145 of file atlsync.h.

146 {
147 ATLASSERT(*this);
148 return ::ReleaseMutex(*this);
149 }

The documentation for this class was generated from the following file: