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

Side by Side Diff: base/threading/platform_thread_posix.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month 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 | « base/threading/platform_thread_mac.mm ('k') | base/threading/thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/platform_thread.h" 5 #include "base/threading/platform_thread.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sched.h> 8 #include <sched.h>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 26 matching lines...) Expand all
37 #if defined(OS_MACOSX) 37 #if defined(OS_MACOSX)
38 void InitThreading(); 38 void InitThreading();
39 #endif 39 #endif
40 40
41 namespace { 41 namespace {
42 42
43 #if !defined(OS_MACOSX) 43 #if !defined(OS_MACOSX)
44 // Mac name code is in in platform_thread_mac.mm. 44 // Mac name code is in in platform_thread_mac.mm.
45 LazyInstance<ThreadLocalPointer<char>, 45 LazyInstance<ThreadLocalPointer<char>,
46 LeakyLazyInstanceTraits<ThreadLocalPointer<char> > > 46 LeakyLazyInstanceTraits<ThreadLocalPointer<char> > >
47 current_thread_name(LINKER_INITIALIZED); 47 current_thread_name = LAZY_INSTANCE_INITIALIZER;
48 #endif 48 #endif
49 49
50 struct ThreadParams { 50 struct ThreadParams {
51 PlatformThread::Delegate* delegate; 51 PlatformThread::Delegate* delegate;
52 bool joinable; 52 bool joinable;
53 }; 53 };
54 54
55 void* ThreadFunc(void* params) { 55 void* ThreadFunc(void* params) {
56 ThreadParams* thread_params = static_cast<ThreadParams*>(params); 56 ThreadParams* thread_params = static_cast<ThreadParams*>(params);
57 PlatformThread::Delegate* delegate = thread_params->delegate; 57 PlatformThread::Delegate* delegate = thread_params->delegate;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // Mac OS X uses lower-level mach APIs 257 // Mac OS X uses lower-level mach APIs
258 258
259 // static 259 // static
260 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) { 260 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) {
261 // TODO(crogers): implement 261 // TODO(crogers): implement
262 NOTIMPLEMENTED(); 262 NOTIMPLEMENTED();
263 } 263 }
264 #endif 264 #endif
265 265
266 } // namespace base 266 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/platform_thread_mac.mm ('k') | base/threading/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698