Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: third_party/WebKit/Source/wtf/ThreadingPthreads.cpp

Issue 1370113006: AtomicStringTable should not be initialized lazily Base URL: https://chromium.googlesource.com/chromium/src.git@AtomitStringTable
Patch Set: Export AtomicStringTable Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/ThreadingWin.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void initializeThreading() 70 void initializeThreading()
71 { 71 {
72 // This should only be called once. 72 // This should only be called once.
73 ASSERT(!atomicallyInitializedStaticMutex); 73 ASSERT(!atomicallyInitializedStaticMutex);
74 74
75 // StringImpl::empty() does not construct its static string in a threadsafe fashion, 75 // StringImpl::empty() does not construct its static string in a threadsafe fashion,
76 // so ensure it has been initialized from here. 76 // so ensure it has been initialized from here.
77 StringImpl::empty(); 77 StringImpl::empty();
78 StringImpl::empty16Bit(); 78 StringImpl::empty16Bit();
79 atomicallyInitializedStaticMutex = new Mutex; 79 atomicallyInitializedStaticMutex = new Mutex;
80 wtfThreadData(); 80 WTFThreadData::createData();
81 s_dtoaP5Mutex = new Mutex; 81 s_dtoaP5Mutex = new Mutex;
82 initializeDates(); 82 initializeDates();
83 // Force initialization of static DoubleToStringConverter converter variable 83 // Force initialization of static DoubleToStringConverter converter variable
84 // inside EcmaScriptConverter function while we are in single thread mode. 84 // inside EcmaScriptConverter function while we are in single thread mode.
85 double_conversion::DoubleToStringConverter::EcmaScriptConverter(); 85 double_conversion::DoubleToStringConverter::EcmaScriptConverter();
86 } 86 }
87 87
88 void lockAtomicallyInitializedStaticMutex() 88 void lockAtomicallyInitializedStaticMutex()
89 { 89 {
90 ASSERT(atomicallyInitializedStaticMutex); 90 ASSERT(atomicallyInitializedStaticMutex);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 261
262 void willCreateThread() 262 void willCreateThread()
263 { 263 {
264 s_threadCreated = true; 264 s_threadCreated = true;
265 } 265 }
266 #endif 266 #endif
267 267
268 } // namespace WTF 268 } // namespace WTF
269 269
270 #endif // USE(PTHREADS) 270 #endif // USE(PTHREADS)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/ThreadingWin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698