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

Side by Side Diff: Source/wtf/ThreadingWin.cpp

Issue 15861022: Build WTF as dll in component build (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix AutoDrainedPool ctor and ThreadSpecificThreadExit exports Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/wtf/ThreadingPthreads.cpp ('k') | Source/wtf/WTFExport.h » ('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, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile, Inc. All rights reserved. 4 * Copyright (C) 2009 Torch Mobile, Inc. 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 161
162 static Mutex& threadMapMutex() 162 static Mutex& threadMapMutex()
163 { 163 {
164 static Mutex mutex; 164 static Mutex mutex;
165 return mutex; 165 return mutex;
166 } 166 }
167 167
168 void initializeThreading() 168 void initializeThreading()
169 { 169 {
170 if (atomicallyInitializedStaticMutex) 170 // This should only be called once.
171 return; 171 ASSERT(!atomicallyInitializedStaticMutex);
172 172
173 WTF::double_conversion::initialize(); 173 WTF::double_conversion::initialize();
174 // StringImpl::empty() does not construct its static string in a threadsafe fashion, 174 // StringImpl::empty() does not construct its static string in a threadsafe fashion,
175 // so ensure it has been initialized from here. 175 // so ensure it has been initialized from here.
176 StringImpl::empty(); 176 StringImpl::empty();
177 atomicallyInitializedStaticMutex = new Mutex; 177 atomicallyInitializedStaticMutex = new Mutex;
178 threadMapMutex(); 178 threadMapMutex();
179 initializeRandomNumberGenerator(); 179 initializeRandomNumberGenerator();
180 wtfThreadData(); 180 wtfThreadData();
181 s_dtoaP5Mutex = new Mutex; 181 s_dtoaP5Mutex = new Mutex;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // Time is too far in the future (and would overflow unsigned long) - wait f orever. 503 // Time is too far in the future (and would overflow unsigned long) - wait f orever.
504 if (absoluteTime - currentTime > static_cast<double>(INT_MAX) / 1000.0) 504 if (absoluteTime - currentTime > static_cast<double>(INT_MAX) / 1000.0)
505 return INFINITE; 505 return INFINITE;
506 506
507 return static_cast<DWORD>((absoluteTime - currentTime) * 1000.0); 507 return static_cast<DWORD>((absoluteTime - currentTime) * 1000.0);
508 } 508 }
509 509
510 } // namespace WTF 510 } // namespace WTF
511 511
512 #endif // OS(WINDOWS) 512 #endif // OS(WINDOWS)
OLDNEW
« no previous file with comments | « Source/wtf/ThreadingPthreads.cpp ('k') | Source/wtf/WTFExport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698