CSingleLock Assertion Failed
-
Hi I am using CSingleLock in a program with a primary thread and a worker thread. On start up or if I do certain operations (both in debug mode) the debuger throws up a Debug Assertion at line 160 in mtex.cpp. Line 160 shows the floowing ASSERT(!m_bAcquired); Does anybody know what the problem is as it’s driving me crazy. Thanks in advance. MTM
-
Hi I am using CSingleLock in a program with a primary thread and a worker thread. On start up or if I do certain operations (both in debug mode) the debuger throws up a Debug Assertion at line 160 in mtex.cpp. Line 160 shows the floowing ASSERT(!m_bAcquired); Does anybody know what the problem is as it’s driving me crazy. Thanks in advance. MTM
mcgmil wrote:
Line 160 shows the floowing ASSERT(!m_bAcquired);
This apparently is not VC++ v6. Correct?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
-
Hi I am using CSingleLock in a program with a primary thread and a worker thread. On start up or if I do certain operations (both in debug mode) the debuger throws up a Debug Assertion at line 160 in mtex.cpp. Line 160 shows the floowing ASSERT(!m_bAcquired); Does anybody know what the problem is as it’s driving me crazy. Thanks in advance. MTM
-
How are you creating the singlelock? it seems that the syncobject you are using its not valid. Example: CCriticalSection g_CS; //global or class member func() { CSingleLock SLock(&g_CS, TRUE); } Good luck. -- modified at 8:50 Wednesday 12th July, 2006
I am Using Visual C++ Standard 2003 In the document header are the following declarations CCriticalSection ImageInfoSyncObject; CSingleLock * pImageInfoLock; In the constructor of the document .ccp file a new single lock object is created CDoc::CDoc() { pImageInfoLock = new CSingleLock (&ImageInfoSyncObject); } Then I use the lock and unlock within a function. Void CDoc::Function() { pImageInfoLock->Lock (); //Code . . . . pImageInfoLock->UnLock (); } Has anybody any further ideas as to why I get the Debug Assertion Failure for mtex.ccp line 106 Thanks MTM
-
I am Using Visual C++ Standard 2003 In the document header are the following declarations CCriticalSection ImageInfoSyncObject; CSingleLock * pImageInfoLock; In the constructor of the document .ccp file a new single lock object is created CDoc::CDoc() { pImageInfoLock = new CSingleLock (&ImageInfoSyncObject); } Then I use the lock and unlock within a function. Void CDoc::Function() { pImageInfoLock->Lock (); //Code . . . . pImageInfoLock->UnLock (); } Has anybody any further ideas as to why I get the Debug Assertion Failure for mtex.ccp line 106 Thanks MTM