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

Side by Side Diff: base/threading/platform_thread_mac.mm

Issue 9117038: Convert all remaining explicit LeakyLazyInstanceTraits users to ::Leaky (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <dlfcn.h> 8 #include <dlfcn.h>
9 #include <mach/mach.h> 9 #include <mach/mach.h>
10 #include <mach/mach_time.h> 10 #include <mach/mach_time.h>
11 #include <mach/thread_policy.h> 11 #include <mach/thread_policy.h>
12 12
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/threading/thread_local.h" 15 #include "base/threading/thread_local.h"
16 #include "base/tracked_objects.h" 16 #include "base/tracked_objects.h"
17 17
18 namespace base { 18 namespace base {
19 19
20 namespace { 20 namespace {
21 21
22 LazyInstance<ThreadLocalPointer<char>, 22 LazyInstance<ThreadLocalPointer<char> >::Leaky
23 LeakyLazyInstanceTraits<ThreadLocalPointer<char> > >
24 current_thread_name = LAZY_INSTANCE_INITIALIZER; 23 current_thread_name = LAZY_INSTANCE_INITIALIZER;
25 24
26 } // namespace 25 } // namespace
27 26
28 // If Cocoa is to be used on more than one thread, it must know that the 27 // If Cocoa is to be used on more than one thread, it must know that the
29 // application is multithreaded. Since it's possible to enter Cocoa code 28 // application is multithreaded. Since it's possible to enter Cocoa code
30 // from threads created by pthread_thread_create, Cocoa won't necessarily 29 // from threads created by pthread_thread_create, Cocoa won't necessarily
31 // be aware that the application is multithreaded. Spawning an NSThread is 30 // be aware that the application is multithreaded. Spawning an NSThread is
32 // enough to get Cocoa to set up for multithreaded operation, so this is done 31 // enough to get Cocoa to set up for multithreaded operation, so this is done
33 // if necessary before pthread_thread_create spawns any threads. 32 // if necessary before pthread_thread_create spawns any threads.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 case kThreadPriority_Normal: 181 case kThreadPriority_Normal:
183 SetPriorityNormal(mach_thread_id); 182 SetPriorityNormal(mach_thread_id);
184 break; 183 break;
185 case kThreadPriority_RealtimeAudio: 184 case kThreadPriority_RealtimeAudio:
186 SetPriorityRealtimeAudio(mach_thread_id); 185 SetPriorityRealtimeAudio(mach_thread_id);
187 break; 186 break;
188 } 187 }
189 } 188 }
190 189
191 } // namespace base 190 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698