Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug in CComClassFactorySingleton (VC++.NET 2003)

6 views
Skip to first unread message

Roman Ryl...

unread,
Aug 1, 2006, 9:01:32 PM8/1/06
to
Hi,

CComClassFactorySingleton::CreateInstance - it looks like a deadlock
bug here:

===
if (m_hrCreate == S_OK && m_spObj == NULL)
{
Lock();
// Did another thread got here first
if (m_hrCreate == S_OK && m_spObj == NULL) // ***
{
// Skipped
Unlock();
}
}
===

if expression in line *** evaluates as false, Unlock will never be
called for a locked for a locked critical section and the calling
thread will freeze.

Roman

Igor Tandetnik

unread,
Aug 1, 2006, 10:11:10 PM8/1/06
to
"Roman Ryl" <ryl...@gmail.com> wrote in message
news:1154480492.5...@i42g2000cwa.googlegroups.com

This bug is fixed in ATL8 (as shipped with VC8 aka VC.NET 2005). As an
aside, you can report bugs to MS here:

http://connect.microsoft.com/VisualStudio

--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


0 new messages