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); } } } } }
internal static void Send(AD7Engine engine, string name, uint pid) { AD7ProcessInfoUpdatedEvent eventObject = new AD7ProcessInfoUpdatedEvent(name, pid); engine.Callback.Send(eventObject, IID, engine, null); }