aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Emulations
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Emulations')
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs21
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
}
}