C++ Static Initializer - Is it thread safe
<p>Usually, when I try to initialize a static variable</p>

<pre><code>class Test2 {
public:
    static vector&lt;string&gt; stringList;
private:
    static bool __init;
    static bool init() {
        stringList.push_back("string1");
        stringList.push_back("string2");
        stringList.push_back("string3");

        return true;
    }
};

// Implement
vector&lt;string&gt; Test2::stringList;
bool Test2::__init = Test2::init();
</code></pre>

<ol>
<li>Is the following code thread safe, during static variable initialization?</li>
<li>Is there any better way to static initialize stringlist, instead of using a seperate static function (init)?</li>
</ol>

<p>Although the initialization shall happen before main function (Hence, there can be no threads to simultaneous access the init), my concern is that :</p>

<ol>
<li>I have an exe application.</li>
<li>My exe application will load a.dll, b.dll and c.dll</li>
<li>a/b/c.dll, in turn will load common.dll. The above code are inside common.dll</li>
<li>I had already verify. Since 3 dll are within single process, they will be referring to the same static variable (vector).</li>
<li>In this case, to prevent 3 dlls from simultaneous access init (Can I view them as 3 threads? Although doesn't make sense at first thought), for the init function, shall I use a critical section to protect it?</li>
</ol>

<p>I am using Windows XP, VC6 and VC2008 compiler.</p>
