修改拨动开关
[mytuuics.git] / dalvik / vm / os / os.h
blob19e2a616895490157ac4d0caaceaffa32a3e7c54
1 /*
2 * Copyright (C) 2011 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 struct Thread;
20 * Raises the scheduling priority of the current thread. Returns the
21 * original priority if successful, or INT_MAX on failure.
22 * Use os_lowerThreadPriority to undo.
24 * TODO: does the GC really need this?
26 int os_raiseThreadPriority();
29 * Sets the current thread scheduling priority. Used to undo the effects
30 * of an earlier call to os_raiseThreadPriority.
32 * TODO: does the GC really need this?
34 void os_lowerThreadPriority(int oldThreadPriority);
37 * Changes the priority of a system thread to match that of the Thread object.
39 * We map a priority value from 1-10 to Linux "nice" values, where lower
40 * numbers indicate higher priority.
42 void os_changeThreadPriority(Thread* thread, int newPriority);
45 * Returns the thread priority for the current thread by querying the system.
46 * This is useful when attaching a thread through JNI.
48 * Returns a value from 1 to 10 (compatible with java.lang.Thread values).
50 int os_getThreadPriorityFromSystem();