Windows Vista adds the
One-Time Initialization
family of functions
which address a common coding pattern:
I want a specific chunk of code to run exactly once,
even in the face of multiple calls from different threads.
There are many implementations of this pattern,
such as the infamous
double-checked lock.
The double-checked lock is very ...