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 | * The following defines the information control block used to manage |
---|
29 | * this class of objects. |
---|
30 | */ |
---|
31 | |
---|
32 | POSIX_EXTERN Objects_Information _POSIX_Threads_Information; |
---|
33 | |
---|
34 | /* |
---|
35 | * These are used to manage the user initialization threads. |
---|
36 | */ |
---|
37 | |
---|
38 | POSIX_EXTERN posix_initialization_threads_table |
---|
39 | *_POSIX_Threads_User_initialization_threads; |
---|
40 | POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_threads; |
---|
41 | |
---|
42 | |
---|
43 | /* |
---|
44 | * _POSIX_Threads_Manager_initialization |
---|
45 | * |
---|
46 | * DESCRIPTION: |
---|
47 | * |
---|
48 | * This routine performs the initialization necessary for this manager. |
---|
49 | */ |
---|
50 | |
---|
51 | void _POSIX_Threads_Manager_initialization( |
---|
52 | unsigned32 maximum_pthreads, |
---|
53 | unsigned32 number_of_initialization_threads, |
---|
54 | posix_initialization_threads_table *user_threads |
---|
55 | ); |
---|
56 | |
---|
57 | /* |
---|
58 | * _POSIX_Threads_Allocate |
---|
59 | * |
---|
60 | * DESCRIPTION: |
---|
61 | * |
---|
62 | * This function allocates a pthread control block from |
---|
63 | * the inactive chain of free pthread control blocks. |
---|
64 | */ |
---|
65 | |
---|
66 | STATIC INLINE Thread_Control *_POSIX_Threads_Allocate( void ); |
---|
67 | |
---|
68 | /* |
---|
69 | * _POSIX_Threads_Free |
---|
70 | * |
---|
71 | * DESCRIPTION: |
---|
72 | * |
---|
73 | * This routine frees a pthread control block to the |
---|
74 | * inactive chain of free pthread control blocks. |
---|
75 | */ |
---|
76 | |
---|
77 | STATIC INLINE void _POSIX_Threads_Free( |
---|
78 | Thread_Control *the_pthread |
---|
79 | ); |
---|
80 | |
---|
81 | /* |
---|
82 | * _POSIX_Threads_Get |
---|
83 | * |
---|
84 | * DESCRIPTION: |
---|
85 | * |
---|
86 | * This function maps pthread IDs to pthread control blocks. |
---|
87 | * If ID corresponds to a local pthread, then it returns |
---|
88 | * the_pthread control pointer which maps to ID and location |
---|
89 | * is set to OBJECTS_LOCAL. if the pthread ID is global and |
---|
90 | * resides on a remote node, then location is set to OBJECTS_REMOTE, |
---|
91 | * and the_pthread is undefined. Otherwise, location is set |
---|
92 | * to OBJECTS_ERROR and the_pthread is undefined. |
---|
93 | */ |
---|
94 | |
---|
95 | STATIC INLINE Thread_Control *_POSIX_Threads_Get( |
---|
96 | pthread_t id, |
---|
97 | Objects_Locations *location |
---|
98 | ); |
---|
99 | |
---|
100 | /* |
---|
101 | * _POSIX_Threads_Is_null |
---|
102 | * |
---|
103 | * DESCRIPTION: |
---|
104 | * |
---|
105 | * This function returns TRUE if the_pthread is NULL and FALSE otherwise. |
---|
106 | */ |
---|
107 | |
---|
108 | STATIC INLINE boolean _POSIX_Threads_Is_null( |
---|
109 | Thread_Control *the_pthread |
---|
110 | ); |
---|
111 | |
---|
112 | #include <rtems/posix/pthread.inl> |
---|
113 | #include <rtems/posix/pthreadmp.h> |
---|
114 | |
---|
115 | #ifdef __cplusplus |
---|
116 | } |
---|
117 | #endif |
---|
118 | |
---|
119 | #endif |
---|
120 | /* end of include file */ |
---|
121 | |
---|