OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 public: | 48 public: |
49 WTFThreadData(); | 49 WTFThreadData(); |
50 ~WTFThreadData(); | 50 ~WTFThreadData(); |
51 | 51 |
52 AtomicStringTable& getAtomicStringTable() { return *m_atomicStringTable; } | 52 AtomicStringTable& getAtomicStringTable() { return *m_atomicStringTable; } |
53 | 53 |
54 ICUConverterWrapper& cachedConverterICU() { return *m_cachedConverterICU; } | 54 ICUConverterWrapper& cachedConverterICU() { return *m_cachedConverterICU; } |
55 | 55 |
56 ThreadIdentifier threadId() const { return m_threadId; } | 56 ThreadIdentifier threadId() const { return m_threadId; } |
57 | 57 |
| 58 #if OS(WIN) && COMPILER(MSVC) |
| 59 static size_t threadStackSize(); |
| 60 #endif |
| 61 |
58 private: | 62 private: |
59 std::unique_ptr<AtomicStringTable> m_atomicStringTable; | 63 std::unique_ptr<AtomicStringTable> m_atomicStringTable; |
60 std::unique_ptr<ICUConverterWrapper> m_cachedConverterICU; | 64 std::unique_ptr<ICUConverterWrapper> m_cachedConverterICU; |
61 | 65 |
62 ThreadIdentifier m_threadId; | 66 ThreadIdentifier m_threadId; |
63 | 67 |
| 68 #if OS(WIN) && COMPILER(MSVC) |
| 69 size_t m_threadStackSize = 0u; |
| 70 #endif |
| 71 |
64 static ThreadSpecific<WTFThreadData>* staticData; | 72 static ThreadSpecific<WTFThreadData>* staticData; |
65 friend WTFThreadData& wtfThreadData(); | 73 friend WTFThreadData& wtfThreadData(); |
66 }; | 74 }; |
67 | 75 |
68 inline WTFThreadData& wtfThreadData() { | 76 inline WTFThreadData& wtfThreadData() { |
69 // WTFThreadData is used on main thread before it could possibly be used | 77 // WTFThreadData is used on main thread before it could possibly be used |
70 // on secondary ones, so there is no need for synchronization here. | 78 // on secondary ones, so there is no need for synchronization here. |
71 if (!WTFThreadData::staticData) | 79 if (!WTFThreadData::staticData) |
72 WTFThreadData::staticData = new ThreadSpecific<WTFThreadData>; | 80 WTFThreadData::staticData = new ThreadSpecific<WTFThreadData>; |
73 return **WTFThreadData::staticData; | 81 return **WTFThreadData::staticData; |
74 } | 82 } |
75 | 83 |
76 } // namespace WTF | 84 } // namespace WTF |
77 | 85 |
78 using WTF::WTFThreadData; | 86 using WTF::WTFThreadData; |
79 using WTF::wtfThreadData; | 87 using WTF::wtfThreadData; |
80 | 88 |
81 #endif // WTFThreadData_h | 89 #endif // WTFThreadData_h |
OLD | NEW |