private void MachineStopHanlder(object sender, MachineStoppedEventArgs e) { if (!CallbackChannelIsReady()) { return; // нет подписчика } _debugCommandEvent.Reset(); _eventChannel.ThreadStopped(1, ConvertStopReason(e.Reason)); _debugCommandEvent.Wait(); }
protected override void OnMachineStopped(MachineInstance machine, MachineStopReason reason) { if (!CallbackChannelIsReady()) { return; // нет подписчика } var handle = GetTokenForThread(Thread.CurrentThread.ManagedThreadId); handle.ThreadEvent.Reset(); _eventChannel.ThreadStopped(1, ConvertStopReason(reason)); handle.ThreadEvent.Wait(); }