Controller thread waits on end of program