12019-11-19 Fujii Hironori <Hironori.Fujii@sony.com>
2
3 [Win] Implement WTF::ThreadSpecific in WTF::Thread
4 https://bugs.webkit.org/show_bug.cgi?id=204341
5
6 Reviewed by NOBODY (OOPS!).
7
8 Thread::destructTLS had a tricky code to defer destroying
9 WTF::Thread in TLS in order to ensure WTF::Thread is destructed
10 after other ThreadSpecific are destructed, which is a part of
11 cause of nasty hanging issue in the process termination (Bug 204192).
12
13 This change implements WTF::ThreadSpecific in WTF::Thread by
14 adding a new class Thread::SpecificStorage to manage TLS. Simplify
15 Thread::destructTLS. Remove threadMapMutex in ThreadingWin.cpp
16
17 * wtf/PlatformWin.cmake:
18 * wtf/ThreadSpecific.h:
19 (WTF::canBeGCThread>::ThreadSpecific):
20 (WTF::canBeGCThread>::get):
21 (WTF::canBeGCThread>::setInTLS):
22 (WTF::canBeGCThread>::destroy):
23 (WTF::canBeGCThread>::~ThreadSpecific): Deleted.
24 * wtf/Threading.h:
25 (WTF::Thread::specificStorage):
26 (WTF::Thread::current):
27 * wtf/win/ThreadSpecificWin.cpp: Removed.
28 * wtf/win/ThreadingWin.cpp:
29 (WTF::Thread::initializeTLSKey):
30 (WTF::Thread::initializeTLS):
31 (WTF::Thread::destructTLS):
32 (WTF::Thread::SpecificStorage::SpecificStorage):
33 (WTF::Thread::SpecificStorage::allocKey):
34 (WTF::Thread::SpecificStorage::get):
35 (WTF::Thread::SpecificStorage::set):
36 (WTF::Thread::SpecificStorage::destroySlots):
37 (): Deleted.
38 (WTF::Thread::currentDying): Deleted.
39 (WTF::Thread::get): Deleted.
40