• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifdef _WIN32
33 typedef uint32_t android_thread_id_t;
34 #else
35 typedef void* android_thread_id_t;
36 #endif
37 
38 typedef int (*android_thread_func_t)(void*);
39 
40 #ifdef __cplusplus
41 } // extern "C"
42 #endif
43 
44 // ---------------------------------------------------------------------------
45 // C++ API
46 #ifdef __cplusplus
47 namespace android {
48 // ---------------------------------------------------------------------------
49 
50 typedef android_thread_id_t thread_id_t;
51 typedef android_thread_func_t thread_func_t;
52 
53 enum {
54     PRIORITY_LOWEST         = ANDROID_PRIORITY_LOWEST,
55     PRIORITY_BACKGROUND     = ANDROID_PRIORITY_BACKGROUND,
56     PRIORITY_NORMAL         = ANDROID_PRIORITY_NORMAL,
57     PRIORITY_FOREGROUND     = ANDROID_PRIORITY_FOREGROUND,
58     PRIORITY_DISPLAY        = ANDROID_PRIORITY_DISPLAY,
59     PRIORITY_URGENT_DISPLAY = ANDROID_PRIORITY_URGENT_DISPLAY,
60     PRIORITY_AUDIO          = ANDROID_PRIORITY_AUDIO,
61     PRIORITY_URGENT_AUDIO   = ANDROID_PRIORITY_URGENT_AUDIO,
62     PRIORITY_HIGHEST        = ANDROID_PRIORITY_HIGHEST,
63     PRIORITY_DEFAULT        = ANDROID_PRIORITY_DEFAULT,
64     PRIORITY_MORE_FAVORABLE = ANDROID_PRIORITY_MORE_FAVORABLE,
65     PRIORITY_LESS_FAVORABLE = ANDROID_PRIORITY_LESS_FAVORABLE,
66 };
67 
68 // ---------------------------------------------------------------------------
69 }  // namespace android
70 #endif  // __cplusplus
71 // ---------------------------------------------------------------------------
72 
73 #endif // _LIBS_UTILS_THREAD_DEFS_H
74