Explain the intricacies of multithreading in Java and write a thread-safe implementation of the Singleton pattern.