Is Meyers' implementation of the Singleton pattern thread safe?

Viewed 63004

Is the following implementation, using lazy initialization, of Singleton (Meyers' Singleton) thread safe?

static Singleton& instance()
{
     static Singleton s;
     return s;
}

If not, why and how to make it thread safe?

6 Answers
Related