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

Side by Side Diff: base/threading/platform_thread.h

Issue 1660273004: base: Set initial thread priority in ThreadFunc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl format and add comment Created 4 years, 10 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
« no previous file with comments | « no previous file | base/threading/platform_thread_android.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) 2012 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 // WARNING: You should *NOT* be using this class directly. PlatformThread is 5 // WARNING: You should *NOT* be using this class directly. PlatformThread is
6 // the low-level platform-specific abstraction to the OS's threading interface. 6 // the low-level platform-specific abstraction to the OS's threading interface.
7 // You should instead be using a message-loop driven Thread, see thread.h. 7 // You should instead be using a message-loop driven Thread, see thread.h.
8 8
9 #ifndef BASE_THREADING_PLATFORM_THREAD_H_ 9 #ifndef BASE_THREADING_PLATFORM_THREAD_H_
10 #define BASE_THREADING_PLATFORM_THREAD_H_ 10 #define BASE_THREADING_PLATFORM_THREAD_H_
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // PlatformThreadHandle. 175 // PlatformThreadHandle.
176 static bool CreateNonJoinable(size_t stack_size, Delegate* delegate); 176 static bool CreateNonJoinable(size_t stack_size, Delegate* delegate);
177 177
178 // Joins with a thread created via the Create function. This function blocks 178 // Joins with a thread created via the Create function. This function blocks
179 // the caller until the designated thread exits. This will invalidate 179 // the caller until the designated thread exits. This will invalidate
180 // |thread_handle|. 180 // |thread_handle|.
181 static void Join(PlatformThreadHandle thread_handle); 181 static void Join(PlatformThreadHandle thread_handle);
182 182
183 // Toggles the current thread's priority at runtime. A thread may not be able 183 // Toggles the current thread's priority at runtime. A thread may not be able
184 // to raise its priority back up after lowering it if the process does not 184 // to raise its priority back up after lowering it if the process does not
185 // have a proper permission, e.g. CAP_SYS_NICE on Linux. 185 // have a proper permission, e.g. CAP_SYS_NICE on Linux. A thread may not be
186 // able to lower its priority back down after raising it to REALTIME_AUDIO.
186 // Since changing other threads' priority is not permitted in favor of 187 // Since changing other threads' priority is not permitted in favor of
187 // security, this interface is restricted to change only the current thread 188 // security, this interface is restricted to change only the current thread
188 // priority (https://crbug.com/399473). 189 // priority (https://crbug.com/399473).
189 static void SetCurrentThreadPriority(ThreadPriority priority); 190 static void SetCurrentThreadPriority(ThreadPriority priority);
190 191
191 static ThreadPriority GetCurrentThreadPriority(); 192 static ThreadPriority GetCurrentThreadPriority();
192 193
193 private: 194 private:
194 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); 195 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread);
195 }; 196 };
196 197
197 } // namespace base 198 } // namespace base
198 199
199 #endif // BASE_THREADING_PLATFORM_THREAD_H_ 200 #endif // BASE_THREADING_PLATFORM_THREAD_H_
OLDNEW
« no previous file with comments | « no previous file | base/threading/platform_thread_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698