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