Thread class for asynchronously ticking circuit components.
A CircuitThread is responsible for ticking all components within a Circuit. Upon initialisation, a reference to the vector of circuit components must be provided for the thread _Run() method to loop through. Each CircuitThread has a buffer number (bufferNo), which is also provided upon initialisation. When creating multiple CircuitThreads, each thread must have their own unique buffer number, beginning at 0 and incrementing by 1 for every thread added. This buffer number corresponds with the Component's buffer number when calling its Tick() method in the CircuitThread's component loop.
The SyncAndResume() method causes the CircuitThread to tick all circuit components once, after which the thread will wait until instructed to resume again. As each component is done processing it hands over control to the next waiting CircuitThread, therefore, from an external control loop (I.e. Circuit's Tick() method) we can simply loop through our array of CircuitThreads calling SyncAndResume() on each. If a circuit thread is busy processing, a call to SyncAndResume() will block momentarily until that thread is done processing.
Definition at line 63 of file CircuitThread.h.