diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-06-17 07:26:14 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-06-17 07:26:14 +0300 |
| commit | dd13554edc2816b026b00fbad26d17f82d8d16c3 (patch) | |
| tree | 4e02ccb755f0e9350d72c3cba902caf50f2e45e9 /Software/Visual_Studio/Tango.Emulations/Emulators | |
| parent | b7db8dc62f437093bcdc7784d7aa6b1fb6a08793 (diff) | |
| download | Tango-dd13554edc2816b026b00fbad26d17f82d8d16c3.tar.gz Tango-dd13554edc2816b026b00fbad26d17f82d8d16c3.zip | |
Merge
Diffstat (limited to 'Software/Visual_Studio/Tango.Emulations/Emulators')
| -rw-r--r-- | Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index c0eea704d..1bf2d3cb7 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -90,6 +90,7 @@ namespace Tango.Emulations.Emulators private String _machineStatusRequestToken; private MachineType _machineType; private ProcessParameters _processParameters; + private bool _failJob; #region Properties @@ -838,6 +839,8 @@ namespace Tango.Emulations.Emulators private void HandleJobRequest(TangoMessage<JobRequest> request) { + _failJob = false; + MachineStatus.State = MachineState.PreparingJob; JobTicket job = request.Message.JobTicket; @@ -992,6 +995,19 @@ namespace Tango.Emulations.Emulators int delay = (100 - (int)watch.ElapsedMilliseconds) > 0 ? (100 - (int)watch.ElapsedMilliseconds) : 5; Thread.Sleep(delay); + if (_failJob) + { + Transporter.SendResponse<JobResponse>(new JobResponse() + { + + }, request.Container.Token, new TransportResponseConfig() { + ErrorCode = ErrorCode.JobThreadBreak, + ErrorMessage = "This is a message about a thread break from the emulator", + EventType = PMR.Diagnostics.EventType.ThreadBreak, + }); + break; + } + if (_cancelJob) { break; @@ -2469,6 +2485,11 @@ namespace Tango.Emulations.Emulators } } + public void FailJobWithEvent() + { + _failJob = true; + } + #endregion } } |
