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

Side by Side Diff: Source/wtf/ThreadingPthreads.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, 6 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/ThreadingPrimitives.h ('k') | 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 void threadWasJoined(ThreadIdentifier); 105 void threadWasJoined(ThreadIdentifier);
106 106
107 static Mutex& threadMapMutex() 107 static Mutex& threadMapMutex()
108 { 108 {
109 DEFINE_STATIC_LOCAL(Mutex, mutex, ()); 109 DEFINE_STATIC_LOCAL(Mutex, mutex, ());
110 return mutex; 110 return mutex;
111 } 111 }
112 112
113 void initializeThreading() 113 void initializeThreading()
114 { 114 {
115 if (atomicallyInitializedStaticMutex) 115 // This should only be called once.
116 return; 116 ASSERT(!atomicallyInitializedStaticMutex);
117 117
118 WTF::double_conversion::initialize(); 118 WTF::double_conversion::initialize();
119 // StringImpl::empty() does not construct its static string in a threadsafe fashion, 119 // StringImpl::empty() does not construct its static string in a threadsafe fashion,
120 // so ensure it has been initialized from here. 120 // so ensure it has been initialized from here.
121 StringImpl::empty(); 121 StringImpl::empty();
122 atomicallyInitializedStaticMutex = new Mutex; 122 atomicallyInitializedStaticMutex = new Mutex;
123 threadMapMutex(); 123 threadMapMutex();
124 initializeRandomNumberGenerator(); 124 initializeRandomNumberGenerator();
125 ThreadIdentifierData::initializeOnce(); 125 ThreadIdentifierData::initializeOnce();
126 StackStats::initialize(); 126 StackStats::initialize();
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 386
387 void ThreadCondition::broadcast() 387 void ThreadCondition::broadcast()
388 { 388 {
389 int result = pthread_cond_broadcast(&m_condition); 389 int result = pthread_cond_broadcast(&m_condition);
390 ASSERT_UNUSED(result, !result); 390 ASSERT_UNUSED(result, !result);
391 } 391 }
392 392
393 } // namespace WTF 393 } // namespace WTF
394 394
395 #endif // USE(PTHREADS) 395 #endif // USE(PTHREADS)
OLDNEW
« no previous file with comments | « Source/wtf/ThreadingPrimitives.h ('k') | Source/wtf/ThreadingWin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698