class CComApartment
CComApartment is used by CComAutoThreadModule to manage an apartment in a thread-pooled EXE module. CComApartment provides methods for incrementing and decrementing the lock count on a thread.
#include <atlbase.h>
Methods | |
Apartment | Marks the starting address of the thread. |
GetLockCount | Returns the current lock count on the thread. |
Lock | Increments the lock count on the thread. |
Unlock | Decrements the lock count on the thread. |
Data Members | |
m_dwThreadID | Contains the identifier of the thread. |
m_hThread | Contains the handle to the thread. |
m_nLockCnt | Contains the current lock count on the thread. |
DWORD Apartment( );
Return Value
Always 0.
Remarks
The thread function marking the starting address of the thread. Automatically set during CComAutoThreadModule::Init.
CComApartment Overview | Class Members
LONG GetLockCount( );
Return Value
The lock count on the thread.
Remarks
Returns the current lock count on the thread.
CComApartment Overview | Class Members
See Also CComApartment::Lock, CComApartment::Unlock, CComApartment::m_nLockCnt
LONG Lock( );
Return Value
A value that may be useful for diagnostics or testing.
Remarks
Performs an atomic increment on the thread's lock count. Called by CComAutoThreadModule::Lock.
The lock count on the thread is used for statistical purposes.
CComApartment Overview | Class Members
See Also CComApartment:Unlock, CComApartment::GetLockCount, CComApartment::m_nLockCnt
LONG Unlock( );
Return Value
A value that may be useful for diagnostics or testing.
Remarks
Performs an atomic decrement on the thread's lock count. Called by CComAutoThreadModule::Unlock.
The lock count on the thread is used for statistical purposes.
CComApartment Overview | Class Members
See Also CComApartment:Lock, CComApartment::GetLockCount, CComApartment::m_nLockCnt
DWORD m_dwThreadID;
Remarks
Contains the identifier of the thread.
CComApartment Overview | Class Members
HANDLE m_hThread;
Remarks
Contains the handle to the thread.
CComApartment Overview | Class Members
LONG m_nLockCnt;
Remarks
Contains the current lock count on the thread.
CComApartment Overview | Class Members
See Also CComApartment::Lock, CComApartment::Unlock