Yes, you do. You need it because the call to that function exists outside any lock which means that multiple threads can run through it at the same time. If that is the case, the thread which is not doing the initialization will go on to try and use the lock in the next line. If the initialization thread hasn't finished initializing the lock that will cause a segfault.