Describe the lifecycle of a thread in Java and explain how you would handle thread synchronization in a multi-threaded environment.