blob: 8eb3d1cbe8790585bb38acb91458e116ecedfa8b [file] [log] [blame]
Mathias Agopian2bd99592012-02-25 23:02:14 -08001/*
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>
Alex Ray567ea472013-07-23 17:06:55 -070023#include <system/thread_defs.h>
Mathias Agopian2bd99592012-02-25 23:02:14 -080024
25// ---------------------------------------------------------------------------
26// C API
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
Dan Willemsen86cf9412016-02-03 23:29:32 -080032#ifdef _WIN32
33typedef uint32_t android_thread_id_t;
34#else
Mathias Agopian2bd99592012-02-25 23:02:14 -080035typedef void* android_thread_id_t;
Dan Willemsen86cf9412016-02-03 23:29:32 -080036#endif
Mathias Agopian2bd99592012-02-25 23:02:14 -080037
38typedef int (*android_thread_func_t)(void*);
39
Mathias Agopian2bd99592012-02-25 23:02:14 -080040#ifdef __cplusplus
41} // extern "C"
42#endif
43
44// ---------------------------------------------------------------------------
45// C++ API
46#ifdef __cplusplus
47namespace android {
48// ---------------------------------------------------------------------------
49
50typedef android_thread_id_t thread_id_t;
51typedef android_thread_func_t thread_func_t;
52
53enum {
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// ---------------------------------------------------------------------------
Pirama Arumuga Nainar90affce2018-04-11 23:10:28 -070069} // namespace android
Mathias Agopian2bd99592012-02-25 23:02:14 -080070#endif // __cplusplus
71// ---------------------------------------------------------------------------
72
Mathias Agopian2bd99592012-02-25 23:02:14 -080073#endif // _LIBS_UTILS_THREAD_DEFS_H