1 /*
2  * Copyright (C) 2007 The Android Open Source Project
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 
17 #ifndef _LIBS_UTILS_THREAD_DEFS_H
18 #define _LIBS_UTILS_THREAD_DEFS_H
19 
20 #include <stdint.h>
21 #include <sys/types.h>
22 #include <system/graphics.h>
23 #include <system/thread_defs.h>
24 
25 // ---------------------------------------------------------------------------
26 // C API
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 typedef void* android_thread_id_t;
33 
34 typedef int (*android_thread_func_t)(void*);
35 
36 #ifdef __cplusplus
37 } // extern "C"
38 #endif
39 
40 // ---------------------------------------------------------------------------
41 // C++ API
42 #ifdef __cplusplus
43 namespace android {
44 // ---------------------------------------------------------------------------
45 
46 typedef android_thread_id_t thread_id_t;
47 typedef android_thread_func_t thread_func_t;
48 
49 enum {
50     PRIORITY_LOWEST         = ANDROID_PRIORITY_LOWEST,
51     PRIORITY_BACKGROUND     = ANDROID_PRIORITY_BACKGROUND,
52     PRIORITY_NORMAL         = ANDROID_PRIORITY_NORMAL,
53     PRIORITY_FOREGROUND     = ANDROID_PRIORITY_FOREGROUND,
54     PRIORITY_DISPLAY        = ANDROID_PRIORITY_DISPLAY,
55     PRIORITY_URGENT_DISPLAY = ANDROID_PRIORITY_URGENT_DISPLAY,
56     PRIORITY_AUDIO          = ANDROID_PRIORITY_AUDIO,
57     PRIORITY_URGENT_AUDIO   = ANDROID_PRIORITY_URGENT_AUDIO,
58     PRIORITY_HIGHEST        = ANDROID_PRIORITY_HIGHEST,
59     PRIORITY_DEFAULT        = ANDROID_PRIORITY_DEFAULT,
60     PRIORITY_MORE_FAVORABLE = ANDROID_PRIORITY_MORE_FAVORABLE,
61     PRIORITY_LESS_FAVORABLE = ANDROID_PRIORITY_LESS_FAVORABLE,
62 };
63 
64 // ---------------------------------------------------------------------------
65 }; // namespace android
66 #endif  // __cplusplus
67 // ---------------------------------------------------------------------------
68 
69 
70 #endif // _LIBS_UTILS_THREAD_DEFS_H
71