Browse Source

Ignoring "Thread is not in collection" that started to appearing in .NET 4.0; I still have no idea why it is happening - it seems that the API is reporting exits of threads without announcing their creation.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4328 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 17 years ago
parent
commit
df4ba376ab
  1. 8
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-Threads.cs
  2. 9
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallback.cs

8
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-Threads.cs

@ -47,6 +47,14 @@ namespace Debugger @@ -47,6 +47,14 @@ namespace Debugger
}
}
internal bool ContainsThread(ICorDebugThread corThread)
{
foreach(Thread thread in threadCollection) {
if (thread.CorThread == corThread) return true;
}
return false;
}
internal Thread GetThread(ICorDebugThread corThread)
{
foreach(Thread thread in threadCollection) {

9
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallback.cs

@ -409,10 +409,17 @@ namespace Debugger @@ -409,10 +409,17 @@ namespace Debugger
public void ExitThread(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread)
{
// It seems that ICorDebugThread is still not dead and can be used
// ICorDebugThread is still not dead and can be used for some operations
if (process.ContainsThread(pThread)) {
EnterCallback(PausedReason.Other, "ExitThread " + pThread.ID, pThread);
process.GetThread(pThread).NotifyExited();
} else {
EnterCallback(PausedReason.Other, "ExitThread " + pThread.ID, process.CorProcess);
// TODO: Investigate
process.TraceMessage("ERROR: Thread does not exist " + pThread.ID);
}
try {
ExitCallback();

Loading…
Cancel
Save