internal void OperationCompleted(SingleSteppingEngine caller, TargetEventArgs result, ThreadingModel model) { if (!ThreadManager.InBackgroundThread && Inferior.HasThreadEvents) { throw new InternalError(); } if (current_state == ProcessState.Stopping) { return; } else if (current_state != ProcessState.Running) { throw new InternalError(); } if ((result != null) && (caller != main_thread) && ((result.Type == TargetEventType.TargetExited) || (result.Type == TargetEventType.TargetSignaled))) { return; } current_state = ProcessState.Stopping; SuspendUserThreads(model, caller); lock (this) { current_state = ProcessState.Stopped; current_operation.Completed(); current_operation = null; stopped_event.Set(); } }