User Tools

Site Tools


getting_started:practical_problems:seq_endless

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
getting_started:practical_problems:seq_endless [2017/09/24 16:47] – external edit 127.0.0.1getting_started:practical_problems:seq_endless [2024/02/16 08:43] (current) ursgraf
Line 7: Line 7:
   }   }
 </code> </code>
-when defining the method action of the sequence. Due to some extraordinary condition such as a fault or stopping the application prematurely the sequence should stop as soon as the sequencer itself stops. For this purpose the correct implementation of the action method is as follows:+when defining the method action of the sequence. Due to some extraordinary condition such as a fault or stopping the application prematurely the sequence should stop as soon as the sequencer itself stops together with all its associated sequences. For this purpose the correct implementation of the action method is as follows:
 <code cpp> <code cpp>
 public: public:
   int action() {   int action() {
-    while (Sequencer::running) step1();+    while (state == SequenceState::running) step1();
   }   }
 </code> </code>
 +This also ensures that if a caller sequence stops due to a monitor, this sequence terminates as well.
  
getting_started/practical_problems/seq_endless.1506264478.txt.gz · Last modified: 2017/09/24 16:47 by 127.0.0.1