Understanding Life cycle of a Thread