Changeset 57829 in webkit for trunk/JavaScriptCore/wtf/WTFThreadData.cpp
- Timestamp:
- Apr 19, 2010, 1:05:53 PM (15 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/WTFThreadData.cpp
r57765 r57829 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 27 27 #include "config.h" 28 #include " ThreadGlobalData.h"28 #include "WTFThreadData.h" 29 29 30 #include "EventNames.h" 31 #include "StringImpl.h" 32 #include "ThreadTimers.h" 33 #include <wtf/UnusedParam.h> 30 namespace WTF { 34 31 35 #if USE(ICU_UNICODE) 36 #include "TextCodecICU.h" 32 #if WTFTHREADDATA_MULTITHREADED 33 ThreadSpecific<WTFThreadData>* WTFThreadData::staticData; 34 #else 35 WTFThreadData* WTFThreadData::staticData; 37 36 #endif 38 37 39 #if PLATFORM(MAC) 40 #include "TextCodecMac.h" 41 #endif 42 43 #if ENABLE(WORKERS) 44 #include <wtf/Threading.h> 45 #include <wtf/ThreadSpecific.h> 46 using namespace WTF; 47 #endif 48 49 namespace WebCore { 50 51 #if ENABLE(WORKERS) 52 ThreadSpecific<ThreadGlobalData>* ThreadGlobalData::staticData; 53 #else 54 ThreadGlobalData* ThreadGlobalData::staticData; 55 #endif 56 57 ThreadGlobalData::ThreadGlobalData() 58 : m_atomicStringTable(new HashSet<StringImpl*>) 59 , m_eventNames(new EventNames) 60 , m_threadTimers(new ThreadTimers) 61 #ifndef NDEBUG 62 , m_isMainThread(isMainThread()) 63 #endif 64 #if USE(ICU_UNICODE) 65 , m_cachedConverterICU(new ICUConverterWrapper) 66 #endif 67 #if PLATFORM(MAC) 68 , m_cachedConverterTEC(new TECConverterWrapper) 38 WTFThreadData::WTFThreadData() 39 : m_atomicStringTable(0) 40 , m_atomicStringTableDestructor(0) 41 #if USE(JSC) 42 , m_defaultIdentifierTable(0) 43 , m_currentIdentifierTable(0) 69 44 #endif 70 45 { 71 // StringImpl::empty() does not construct its static string in a threadsafe fashion,72 // so ensure it has been initialized from here.73 //74 // This constructor will have been called on the main thread before being called on75 // any other thread, and is only called once per thread.76 StringImpl::empty();77 46 } 78 47 79 ThreadGlobalData::~ThreadGlobalData()48 WTFThreadData::~WTFThreadData() 80 49 { 81 #if PLATFORM(MAC) 82 delete m_cachedConverterTEC; 83 #endif 84 #if USE(ICU_UNICODE) 85 delete m_cachedConverterICU; 86 #endif 87 delete m_eventNames; 88 delete m_atomicStringTable; 89 delete m_threadTimers; 50 if (m_atomicStringTableDestructor) 51 m_atomicStringTableDestructor(m_atomicStringTable); 90 52 } 91 53
Note:
See TracChangeset
for help on using the changeset viewer.