Add thread-safe singleton implementations.