In this FPGA design example, three threads are created and then cancelled from the
main() thread. Upon creation, these threads set their cancellation mode and proceed to install cleanup handlers. Every thread can be cancelled at any moment. Cleanup handlers are then useful to make sure that the threads free resources prior to their cancellation.
The embedded project demonstrates:
- How these cleanup handlers are called upon cancellation.
- How you can create threads with their stack allocated statically. This is a usual practice in real-time systems since it favors thread creation speed.
- How to create threads with a priority other than default.
The TSK3000, Terminal Instrument and SRAM controller are used in this example.
Altium Designer projects included in this download:
- Thread_Cancellation.PrjFpg
- Thread_Cancellation.PrjEmb