Adding code for multiThreadProgram to Exit