[5e9b32b] | 1 | /* rtems/posix/pthread.h |
---|
| 2 | * |
---|
| 3 | * This include file contains all the private support information for |
---|
| 4 | * POSIX threads. |
---|
| 5 | * |
---|
[60b791ad] | 6 | * COPYRIGHT (c) 1989-1998. |
---|
[5e9b32b] | 7 | * On-Line Applications Research Corporation (OAR). |
---|
[03f2154e] | 8 | * Copyright assigned to U.S. Government, 1994. |
---|
[5e9b32b] | 9 | * |
---|
[98e4ebf5] | 10 | * The license and distribution terms for this file may be |
---|
| 11 | * found in the file LICENSE in this distribution or at |
---|
[03f2154e] | 12 | * http://www.OARcorp.com/rtems/license.html. |
---|
[5e9b32b] | 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 | |
---|
[ed5a518] | 27 | #define PTHREAD_MINIMUM_STACK_SIZE (STACK_MINIMUM_SIZE * 2) |
---|
| 28 | |
---|
[5e9b32b] | 29 | /* |
---|
| 30 | * The following defines the information control block used to manage |
---|
| 31 | * this class of objects. |
---|
| 32 | */ |
---|
| 33 | |
---|
[c627b2a3] | 34 | POSIX_EXTERN Objects_Information _POSIX_Threads_Information; |
---|
[5a18e04] | 35 | |
---|
| 36 | /* |
---|
[dd32d883] | 37 | * These are used to manage the user initialization threads. |
---|
[5a18e04] | 38 | */ |
---|
| 39 | |
---|
[dd32d883] | 40 | POSIX_EXTERN posix_initialization_threads_table |
---|
| 41 | *_POSIX_Threads_User_initialization_threads; |
---|
| 42 | POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_threads; |
---|
[5a18e04] | 43 | |
---|
[5e9b32b] | 44 | |
---|
| 45 | /* |
---|
| 46 | * _POSIX_Threads_Manager_initialization |
---|
| 47 | * |
---|
| 48 | * DESCRIPTION: |
---|
| 49 | * |
---|
| 50 | * This routine performs the initialization necessary for this manager. |
---|
| 51 | */ |
---|
| 52 | |
---|
| 53 | void _POSIX_Threads_Manager_initialization( |
---|
[dd32d883] | 54 | unsigned32 maximum_pthreads, |
---|
| 55 | unsigned32 number_of_initialization_threads, |
---|
| 56 | posix_initialization_threads_table *user_threads |
---|
[5e9b32b] | 57 | ); |
---|
| 58 | |
---|
| 59 | /* |
---|
| 60 | * _POSIX_Threads_Allocate |
---|
| 61 | * |
---|
| 62 | * DESCRIPTION: |
---|
| 63 | * |
---|
| 64 | * This function allocates a pthread control block from |
---|
| 65 | * the inactive chain of free pthread control blocks. |
---|
| 66 | */ |
---|
| 67 | |
---|
[503dc058] | 68 | RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ); |
---|
[5e9b32b] | 69 | |
---|
| 70 | /* |
---|
| 71 | * _POSIX_Threads_Free |
---|
| 72 | * |
---|
| 73 | * DESCRIPTION: |
---|
| 74 | * |
---|
| 75 | * This routine frees a pthread control block to the |
---|
| 76 | * inactive chain of free pthread control blocks. |
---|
| 77 | */ |
---|
| 78 | |
---|
[503dc058] | 79 | RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free( |
---|
[4427a64] | 80 | Thread_Control *the_pthread |
---|
[5e9b32b] | 81 | ); |
---|
| 82 | |
---|
| 83 | /* |
---|
| 84 | * _POSIX_Threads_Get |
---|
| 85 | * |
---|
| 86 | * DESCRIPTION: |
---|
| 87 | * |
---|
| 88 | * This function maps pthread IDs to pthread control blocks. |
---|
| 89 | * If ID corresponds to a local pthread, then it returns |
---|
| 90 | * the_pthread control pointer which maps to ID and location |
---|
| 91 | * is set to OBJECTS_LOCAL. if the pthread ID is global and |
---|
| 92 | * resides on a remote node, then location is set to OBJECTS_REMOTE, |
---|
| 93 | * and the_pthread is undefined. Otherwise, location is set |
---|
| 94 | * to OBJECTS_ERROR and the_pthread is undefined. |
---|
| 95 | */ |
---|
| 96 | |
---|
[503dc058] | 97 | RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get( |
---|
[4427a64] | 98 | pthread_t id, |
---|
[5e9b32b] | 99 | Objects_Locations *location |
---|
| 100 | ); |
---|
| 101 | |
---|
| 102 | /* |
---|
| 103 | * _POSIX_Threads_Is_null |
---|
| 104 | * |
---|
| 105 | * DESCRIPTION: |
---|
| 106 | * |
---|
| 107 | * This function returns TRUE if the_pthread is NULL and FALSE otherwise. |
---|
| 108 | */ |
---|
| 109 | |
---|
[503dc058] | 110 | RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null( |
---|
[4427a64] | 111 | Thread_Control *the_pthread |
---|
[5e9b32b] | 112 | ); |
---|
| 113 | |
---|
| 114 | #include <rtems/posix/pthread.inl> |
---|
[97e2729d] | 115 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[5e9b32b] | 116 | #include <rtems/posix/pthreadmp.h> |
---|
[97e2729d] | 117 | #endif |
---|
[5e9b32b] | 118 | |
---|
| 119 | #ifdef __cplusplus |
---|
| 120 | } |
---|
| 121 | #endif |
---|
| 122 | |
---|
| 123 | #endif |
---|
| 124 | /* end of include file */ |
---|
| 125 | |
---|