What happens is ASSERT! I keep finding that my CSingleLock.m_bAcquired == true. When this happens the ASSERT pounds the desktop.
I don't understand how m_bAcquired becomes true.
I create the locking mechanism with a wrapper class. It is included below.
Please note that my destructor is doing an Unlock.
Please note that my constructor accepts a CSingleLock instantiated with the CCriticalSection created in the main thread.
The CSingleLock is static in the class that consumes the code below.
FYI: I have read the following thread and it doesn't appear to be relevant:
http://www.thescripts.com/forum/thread283101.html
[code]
class CQCriticalSection
{
public:
CQCriticalSection(CSingleLock* pcslLock);
virtual ~CQCriticalSection();private:
CSingleLock* m_pcslLock;};
CQCriticalSection::CQCriticalSection(CSingleLock* pcslLock)
{
_ASSERT(pcslLock != static_cast<const CSingleLock*>(0));
m_pcslLock = pcslLock;
m_pcslLock->Lock();};
CQCriticalSection::~CQCriticalSection()
{if (m_pcslLock != static_cast<CSingleLock*>(0))
{
m_pcslLock->Unlock();
}}