An example of some threads, their methods and ways to avoid problems that can be encountered when threading
not the preferred way but is demoed here
this means the class can stil extend another class
to make calling thread go into a waiting state until referenced thread terminates
A thread can be asked, but not forced to be interuppted
read locks can be held and used by mutliple threads concurrently, write threads cannot. Locks released in finally block
Simulates a gadget factory a supply chain and consumers of the gadgets. Uses two infinite while loops that hand control to each other depending on the state of the supply chain. Uses wait and notify to communicate between the threads