• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2008 The Android Open Source Project
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *  * Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  *  * Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in
12  *    the documentation and/or other materials provided with the
13  *    distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  */
28 
29 #pragma once
30 
31 #include <sys/cdefs.h>
32 #include <sys/types.h>
33 
34 typedef struct {
35   uint32_t flags;
36   void* stack_base;
37   size_t stack_size;
38   size_t guard_size;
39   int32_t sched_policy;
40   int32_t sched_priority;
41 #ifdef __LP64__
42   char __reserved[16];
43 #endif
44 } pthread_attr_t;
45 
46 typedef struct {
47 #if defined(__LP64__)
48   int64_t __private[4];
49 #else
50   int32_t __private[8];
51 #endif
52 } pthread_barrier_t;
53 
54 typedef int pthread_barrierattr_t;
55 
56 typedef struct {
57 #if defined(__LP64__)
58   int32_t __private[12];
59 #else
60   int32_t __private[1];
61 #endif
62 } pthread_cond_t;
63 
64 typedef long pthread_condattr_t;
65 
66 typedef int pthread_key_t;
67 
68 typedef struct {
69 #if defined(__LP64__)
70   int32_t __private[10];
71 #else
72   int32_t __private[1];
73 #endif
74 } pthread_mutex_t;
75 
76 typedef long pthread_mutexattr_t;
77 
78 typedef int pthread_once_t;
79 
80 typedef struct {
81 #if defined(__LP64__)
82   int32_t __private[14];
83 #else
84   int32_t __private[10];
85 #endif
86 } pthread_rwlock_t;
87 
88 typedef long pthread_rwlockattr_t;
89 
90 typedef struct {
91 #if defined(__LP64__)
92   int64_t __private;
93 #else
94   int32_t __private[2];
95 #endif
96 } pthread_spinlock_t;
97 
98 typedef long pthread_t;
99