Path: blob/21.2-virgl/include/android_stub/system/thread_defs.h
4547 views
/*1* Copyright (C) 2013 The Android Open Source Project2*3* Licensed under the Apache License, Version 2.0 (the "License");4* you may not use this file except in compliance with the License.5* You may obtain a copy of the License at6*7* http://www.apache.org/licenses/LICENSE-2.08*9* Unless required by applicable law or agreed to in writing, software10* distributed under the License is distributed on an "AS IS" BASIS,11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12* See the License for the specific language governing permissions and13* limitations under the License.14*/1516#ifndef ANDROID_THREAD_DEFS_H17#define ANDROID_THREAD_DEFS_H1819#include "graphics.h"2021#if defined(__cplusplus)22extern "C" {23#endif2425enum {26/*27* ***********************************************28* ** Keep in sync with android.os.Process.java **29* ***********************************************30*31* This maps directly to the "nice" priorities we use in Android.32* A thread priority should be chosen inverse-proportionally to33* the amount of work the thread is expected to do. The more work34* a thread will do, the less favorable priority it should get so that35* it doesn't starve the system. Threads not behaving properly might36* be "punished" by the kernel.37* Use the levels below when appropriate. Intermediate values are38* acceptable, preferably use the {MORE|LESS}_FAVORABLE constants below.39*/40ANDROID_PRIORITY_LOWEST = 19,4142/* use for background tasks */43ANDROID_PRIORITY_BACKGROUND = 10,4445/* most threads run at normal priority */46ANDROID_PRIORITY_NORMAL = 0,4748/* threads currently running a UI that the user is interacting with */49ANDROID_PRIORITY_FOREGROUND = -2,5051/* the main UI thread has a slightly more favorable priority */52ANDROID_PRIORITY_DISPLAY = -4,5354/* ui service treads might want to run at a urgent display (uncommon) */55ANDROID_PRIORITY_URGENT_DISPLAY = HAL_PRIORITY_URGENT_DISPLAY,5657/* all normal video threads */58ANDROID_PRIORITY_VIDEO = -10,5960/* all normal audio threads */61ANDROID_PRIORITY_AUDIO = -16,6263/* service audio threads (uncommon) */64ANDROID_PRIORITY_URGENT_AUDIO = -19,6566/* should never be used in practice. regular process might not67* be allowed to use this level */68ANDROID_PRIORITY_HIGHEST = -20,6970ANDROID_PRIORITY_DEFAULT = ANDROID_PRIORITY_NORMAL,71ANDROID_PRIORITY_MORE_FAVORABLE = -1,72ANDROID_PRIORITY_LESS_FAVORABLE = +1,73};7475#if defined(__cplusplus)76}77#endif7879#endif /* ANDROID_THREAD_DEFS_H */808182