OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) | 3 * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) |
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 } // namespace internal | 76 } // namespace internal |
77 | 77 |
78 static Mutex* atomicallyInitializedStaticMutex; | 78 static Mutex* atomicallyInitializedStaticMutex; |
79 | 79 |
80 void initializeThreading() { | 80 void initializeThreading() { |
81 // This should only be called once. | 81 // This should only be called once. |
82 DCHECK(!atomicallyInitializedStaticMutex); | 82 DCHECK(!atomicallyInitializedStaticMutex); |
83 | 83 |
| 84 WTFThreadData::initialize(); |
| 85 |
84 atomicallyInitializedStaticMutex = new Mutex; | 86 atomicallyInitializedStaticMutex = new Mutex; |
85 wtfThreadData(); | |
86 initializeDates(); | 87 initializeDates(); |
87 // Force initialization of static DoubleToStringConverter converter variable | 88 // Force initialization of static DoubleToStringConverter converter variable |
88 // inside EcmaScriptConverter function while we are in single thread mode. | 89 // inside EcmaScriptConverter function while we are in single thread mode. |
89 double_conversion::DoubleToStringConverter::EcmaScriptConverter(); | 90 double_conversion::DoubleToStringConverter::EcmaScriptConverter(); |
90 } | 91 } |
91 | 92 |
92 void lockAtomicallyInitializedStaticMutex() { | 93 void lockAtomicallyInitializedStaticMutex() { |
93 DCHECK(atomicallyInitializedStaticMutex); | 94 DCHECK(atomicallyInitializedStaticMutex); |
94 atomicallyInitializedStaticMutex->lock(); | 95 atomicallyInitializedStaticMutex->lock(); |
95 } | 96 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 } | 243 } |
243 | 244 |
244 void willCreateThread() { | 245 void willCreateThread() { |
245 s_threadCreated = true; | 246 s_threadCreated = true; |
246 } | 247 } |
247 #endif | 248 #endif |
248 | 249 |
249 } // namespace WTF | 250 } // namespace WTF |
250 | 251 |
251 #endif // OS(POSIX) | 252 #endif // OS(POSIX) |
OLD | NEW |