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

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: thakis comment, renamed LAZY_INSTANCE_INITIALIZER 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
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 25 matching lines...) Expand all
36 #if defined(OS_MACOSX) 36 #if defined(OS_MACOSX)
37 void InitThreading(); 37 void InitThreading();
38 #endif 38 #endif
39 39
40 namespace { 40 namespace {
41 41
42 #if !defined(OS_MACOSX) 42 #if !defined(OS_MACOSX)
43 // Mac name code is in in platform_thread_mac.mm. 43 // Mac name code is in in platform_thread_mac.mm.
44 LazyInstance<ThreadLocalPointer<char>, 44 LazyInstance<ThreadLocalPointer<char>,
45 LeakyLazyInstanceTraits<ThreadLocalPointer<char> > > 45 LeakyLazyInstanceTraits<ThreadLocalPointer<char> > >
46 current_thread_name(LINKER_INITIALIZED); 46 current_thread_name = LAZY_INSTANCE_INITIALIZER;
47 #endif 47 #endif
48 48
49 struct ThreadParams { 49 struct ThreadParams {
50 PlatformThread::Delegate* delegate; 50 PlatformThread::Delegate* delegate;
51 bool joinable; 51 bool joinable;
52 }; 52 };
53 53
54 void* ThreadFunc(void* params) { 54 void* ThreadFunc(void* params) {
55 ThreadParams* thread_params = static_cast<ThreadParams*>(params); 55 ThreadParams* thread_params = static_cast<ThreadParams*>(params);
56 PlatformThread::Delegate* delegate = thread_params->delegate; 56 PlatformThread::Delegate* delegate = thread_params->delegate;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // Mac OS X uses lower-level mach APIs 254 // Mac OS X uses lower-level mach APIs
255 255
256 // static 256 // static
257 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) { 257 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) {
258 // TODO(crogers): implement 258 // TODO(crogers): implement
259 NOTIMPLEMENTED(); 259 NOTIMPLEMENTED();
260 } 260 }
261 #endif 261 #endif
262 262
263 } // namespace base 263 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698