1 | /* rtems/posix/pthread.h |
---|
2 | * |
---|
3 | * This include file contains all the private support information for |
---|
4 | * POSIX threads. |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * All rights assigned to U.S. Government, 1994. |
---|
9 | * |
---|
10 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
11 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
12 | * notice must appear in all copies of this file and its derivatives. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef __RTEMS_POSIX_THREADS_h |
---|
18 | #define __RTEMS_POSIX_THREADS_h |
---|
19 | |
---|
20 | #ifdef __cplusplus |
---|
21 | extern "C" { |
---|
22 | #endif |
---|
23 | |
---|
24 | #include <rtems/posix/config.h> |
---|
25 | #include <rtems/posix/threadsup.h> |
---|
26 | |
---|
27 | /* |
---|
28 | * Data Structure used to manage a POSIX thread |
---|
29 | */ |
---|
30 | |
---|
31 | typedef Thread_Control POSIX_Threads_Control; |
---|
32 | |
---|
33 | /* |
---|
34 | * The following defines the information control block used to manage |
---|
35 | * this class of objects. |
---|
36 | */ |
---|
37 | |
---|
38 | POSIX_EXTERN Objects_Information _POSIX_Threads_Information; |
---|
39 | |
---|
40 | /* |
---|
41 | * These are used to manage the user initialization threads. |
---|
42 | */ |
---|
43 | |
---|
44 | POSIX_EXTERN posix_initialization_threads_table |
---|
45 | *_POSIX_Threads_User_initialization_threads; |
---|
46 | POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_threads; |
---|
47 | |
---|
48 | |
---|
49 | /* |
---|
50 | * _POSIX_Threads_Manager_initialization |
---|
51 | * |
---|
52 | * DESCRIPTION: |
---|
53 | * |
---|
54 | * This routine performs the initialization necessary for this manager. |
---|
55 | */ |
---|
56 | |
---|
57 | void _POSIX_Threads_Manager_initialization( |
---|
58 | unsigned32 maximum_pthreads, |
---|
59 | unsigned32 number_of_initialization_threads, |
---|
60 | posix_initialization_threads_table *user_threads |
---|
61 | ); |
---|
62 | |
---|
63 | /* |
---|
64 | * _POSIX_Threads_Allocate |
---|
65 | * |
---|
66 | * DESCRIPTION: |
---|
67 | * |
---|
68 | * This function allocates a pthread control block from |
---|
69 | * the inactive chain of free pthread control blocks. |
---|
70 | */ |
---|
71 | |
---|
72 | STATIC INLINE POSIX_Threads_Control *_POSIX_Threads_Allocate( void ); |
---|
73 | |
---|
74 | /* |
---|
75 | * _POSIX_Threads_Free |
---|
76 | * |
---|
77 | * DESCRIPTION: |
---|
78 | * |
---|
79 | * This routine frees a pthread control block to the |
---|
80 | * inactive chain of free pthread control blocks. |
---|
81 | */ |
---|
82 | |
---|
83 | STATIC INLINE void _POSIX_Threads_Free( |
---|
84 | POSIX_Threads_Control *the_pthread |
---|
85 | ); |
---|
86 | |
---|
87 | /* |
---|
88 | * _POSIX_Threads_Get |
---|
89 | * |
---|
90 | * DESCRIPTION: |
---|
91 | * |
---|
92 | * This function maps pthread IDs to pthread control blocks. |
---|
93 | * If ID corresponds to a local pthread, then it returns |
---|
94 | * the_pthread control pointer which maps to ID and location |
---|
95 | * is set to OBJECTS_LOCAL. if the pthread ID is global and |
---|
96 | * resides on a remote node, then location is set to OBJECTS_REMOTE, |
---|
97 | * and the_pthread is undefined. Otherwise, location is set |
---|
98 | * to OBJECTS_ERROR and the_pthread is undefined. |
---|
99 | */ |
---|
100 | |
---|
101 | STATIC INLINE POSIX_Threads_Control *_POSIX_Threads_Get( |
---|
102 | Objects_Id *id, |
---|
103 | Objects_Locations *location |
---|
104 | ); |
---|
105 | |
---|
106 | /* |
---|
107 | * _POSIX_Threads_Is_null |
---|
108 | * |
---|
109 | * DESCRIPTION: |
---|
110 | * |
---|
111 | * This function returns TRUE if the_pthread is NULL and FALSE otherwise. |
---|
112 | */ |
---|
113 | |
---|
114 | STATIC INLINE boolean _POSIX_Threads_Is_null( |
---|
115 | POSIX_Threads_Control *the_pthread |
---|
116 | ); |
---|
117 | |
---|
118 | #include <rtems/posix/pthread.inl> |
---|
119 | #include <rtems/posix/pthreadmp.h> |
---|
120 | |
---|
121 | #ifdef __cplusplus |
---|
122 | } |
---|
123 | #endif |
---|
124 | |
---|
125 | #endif |
---|
126 | /* end of include file */ |
---|
127 | |
---|