[Win] Use NeverDestroyed template.
https://bugs.webkit.org/show_bug.cgi?id=157345

Reviewed by Darin Adler.

* wtf/ThreadingWin.cpp:
(WTF::threadMapMutex):
(WTF::threadMap):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@200420 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index 7aa6b47..893b7da 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,14 @@
+2016-05-04  Per Arne Vollan  <peavo@outlook.com>
+
+        [Win] Use NeverDestroyed template.
+        https://bugs.webkit.org/show_bug.cgi?id=157345
+
+        Reviewed by Darin Adler.
+
+        * wtf/ThreadingWin.cpp:
+        (WTF::threadMapMutex):
+        (WTF::threadMap):
+
 2016-05-04  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, rolling out r200383 and r200406.
diff --git a/Source/WTF/wtf/ThreadingWin.cpp b/Source/WTF/wtf/ThreadingWin.cpp
index 7644024..068646d 100644
--- a/Source/WTF/wtf/ThreadingWin.cpp
+++ b/Source/WTF/wtf/ThreadingWin.cpp
@@ -99,6 +99,7 @@
 #include <wtf/CurrentTime.h>
 #include <wtf/HashMap.h>
 #include <wtf/MathExtras.h>
+#include <wtf/NeverDestroyed.h>
 #include <wtf/RandomNumberSeed.h>
 #include <wtf/WTFThreadData.h>
 
@@ -141,7 +142,7 @@
 
 static Mutex& threadMapMutex()
 {
-    static Mutex mutex;
+    static NeverDestroyed<Mutex> mutex;
     return mutex;
 }
 
@@ -166,7 +167,7 @@
 
 static HashMap<DWORD, HANDLE>& threadMap()
 {
-    static HashMap<DWORD, HANDLE> map;
+    static NeverDestroyed<HashMap<DWORD, HANDLE>> map;
     return map;
 }