Created On:  05 August 2010

Problem:

When running DevPartner Error Detection against a mixed-mode application, the message "Calling SuspendThread() while executing under Error Detection may lead to spurious deadlocks" may appear.

Resolution:

The message: "Calling SuspendThread() while executing under Error Detection may lead to spurious deadlocks" is only presented when attempting to use Error Detection on mixed mode applications and it is present due to an issue with Loader Locking.  You can find more information regarding Loader Locking and the issues associated with its use in mixed mode applications at the following locations:

http://download.microsoft.com/download/a/f/7/af7777e5-7dcd-4800-8a0a-b18336565f5b/dll_bestprac.doc

http://msdn.microsoft.com/en-us/library/dd744765(VS.85).aspx

DevPartner Studio only displays this message when code calls an API that calls suspendThread().  For example, AfxBeginThread calls suspendThread and would trigger this warning, So this warning may occur even if suspendThread() is not directly called. 

The message only appears with Deadlock Analysis enabled.  If confident that there is no potential Loader Locking issue after disabling Deadlock Analysis, the message no longer displays.
Incident #2450020