chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Quintiq file version 2.0
#parent: #root
Method CheckNeedsIterationThread
{
  Description: 'Check if the current snapshotcomponent needs an iteration thread. If so, add it'
  TextBody:
  [*
    // jps1 Jun-4-2020 (created)
    
    //Needs an iterationthread if this is a leaf or the component is an iterator that does not yet have a thread
    //Please note this method is very similar to LibOpt_Component::CheckAddIterationThreads and should be aligned with that one
    //Only reason for not directly aligning it is that it is on different objects, and therefore hard to keep the code exactly the same
    if( this.ChildrenAsSnapshotComponent( relsize ) = 0 or ( this.Component().istype( LibOpt_Iterator ) and isnull( this.ExecutingIterationThread() ) ) )
    {
      iterThread := LibOpt_IterationThread::FindCreateAvailableThread( this.Run(), this.GetIterationPartOwner().PrecisionTimeStampStartComponent() );
      this.ExecutingIterationThread( relset, iterThread );
    }
  *]
  InterfaceProperties { Accessibility: 'Module' }
}