[5e9b32b] | 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 | |
---|
[5a18e04] | 24 | #include <rtems/posix/config.h> |
---|
| 25 | #include <rtems/posix/threadsup.h> |
---|
| 26 | |
---|
[5e9b32b] | 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 | |
---|
[c627b2a3] | 38 | POSIX_EXTERN Objects_Information _POSIX_Threads_Information; |
---|
[5a18e04] | 39 | |
---|
| 40 | /* |
---|
| 41 | * These are used to manage the user initialization tasks. |
---|
| 42 | */ |
---|
| 43 | |
---|
[c627b2a3] | 44 | POSIX_EXTERN posix_initialization_tasks_table |
---|
[5a18e04] | 45 | *_POSIX_Threads_User_initialization_tasks; |
---|
[c627b2a3] | 46 | POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_tasks; |
---|
[5a18e04] | 47 | |
---|
[5e9b32b] | 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( |
---|
[5a18e04] | 58 | unsigned32 maximum_pthreads, |
---|
| 59 | unsigned32 number_of_initialization_tasks, |
---|
| 60 | posix_initialization_tasks_table *user_tasks |
---|
[5e9b32b] | 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 | |
---|
[ece8c9a] | 83 | STATIC INLINE void _POSIX_Threads_Free( |
---|
[5e9b32b] | 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 | |
---|
[ece8c9a] | 101 | STATIC INLINE POSIX_Threads_Control *_POSIX_Threads_Get( |
---|
[5e9b32b] | 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 | |
---|
[ece8c9a] | 114 | STATIC INLINE boolean _POSIX_Threads_Is_null( |
---|
[5e9b32b] | 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 | |
---|