Esempio n. 1
0
        internal void SendThreadEvents(object sender, EventArgs e)
        {
            List <DebuggedThread> deadThreads;
            List <DebuggedThread> newThreads;

            lock (_threadList)
            {
                deadThreads  = _deadThreads;
                _deadThreads = null;
                newThreads   = _newThreads;
                _newThreads  = null;
            }
            if (newThreads != null)
            {
                foreach (var newt in newThreads)
                {
                    if (!newt.ChildThread)
                    {
                        _callback.OnThreadStart(newt);
                    }
                }
            }
            if (deadThreads != null)
            {
                foreach (var dead in deadThreads)
                {
                    if (!dead.ChildThread)
                    {
                        // Send the destroy event outside the lock
                        _callback.OnThreadExit(dead, 0);
                    }
                }
            }
        }
Esempio n. 2
0
 internal void SendThreadEvents(object sender, EventArgs e)
 {
     if (_debugger.Engine.ProgramCreateEventSent)
     {
         List <DebuggedThread> deadThreads;
         List <DebuggedThread> newThreads;
         lock (_threadList)
         {
             deadThreads  = _deadThreads;
             _deadThreads = null;
             newThreads   = _newThreads;
             _newThreads  = null;
         }
         if (newThreads != null)
         {
             if (newThreads.Count == _threadList.Count)
             {
                 // These are the first threads. Send a processInfoUpdateEvent too.
                 AD7ProcessInfoUpdatedEvent.Send(_debugger.Engine, _debugger.LaunchOptions.ExePath, (uint)_debugger.PidByInferior("i1"));
             }
             foreach (var newt in newThreads)
             {
                 // If we are child process debugging, check and see if its a child thread
                 if (!(_debugger.IsChildProcessDebugging && newt.ChildThread))
                 {
                     _callback.OnThreadStart(newt);
                 }
             }
         }
         if (deadThreads != null)
         {
             foreach (var dead in deadThreads)
             {
                 // If we are child process debugging, check and see if its a child thread
                 if (!(_debugger.IsChildProcessDebugging && dead.ChildThread))
                 {
                     // Send the destroy event outside the lock
                     _callback.OnThreadExit(dead, 0);
                 }
             }
         }
     }
 }