----------------------------------------------------------------------- -- Howard Eng 2/94-- -- Unixpros, Inc. -- -- -- -- This package defines common data types that map between "cma.h" -- -- and the Ada environment. -- ----------------------------------------------------------------------- with DCE_ADA_SEMAPHORE; with SYSTEM; with UNCHECKED_CONVERSION; with UNCHECKED_DEALLOCATION; package CMA_TYPES is procedure ADA_THD_RESUME_ADA_TASKING; procedure ADA_THD_SUSPEND_ADA_TASKING; subtype C_INTEGER is INTEGER; -- Corresponding C "int" type C_INTEGER_P is access C_INTEGER; subtype LONG is INTEGER; -- 32 bits subtype SHORT is SHORT_INTEGER; type ADA_PTHREAD_EXC_T is ( ADA_PTHREAD_CANCEL_E, ADA_TIMED_OUT_E, ADA_NO_MEMORY_E, ADA_EBUSY_E, ADA_EDEADLK_E, ADA_INVALID_OBJ_E, ADA_USE_ERROR_E, ADA_EOPNOTSUPP_E, ADA_EXIT_THREAD_E, ADA_NO_RESOURCES_E, ADA_SIGPIPE_E, ADA_SIGSYS_E, ADA_SIGTRAP_E, ADA_SIGIOT_E, ADA_SIGEMT_E, ADA_MAX_EXCEPTIONS ); for ADA_PTHREAD_EXC_T'SIZE use C_INTEGER'SIZE; -- -- task used as a lock for examining internal thread, mutex, and -- condition variable structures -- task type INTERNAL_LOCK_TYPE is entry LOCK; entry UNLOCK; entry STOP; end INTERNAL_LOCK_TYPE; for INTERNAL_LOCK_TYPE'STORAGE_SIZE use 4000; type INTERNAL_LOCK is access INTERNAL_LOCK_TYPE; function ADA_THD_CREATE_INT_LOCK return INTERNAL_LOCK; pragma EXPORT( C, ADA_THD_CREATE_INT_LOCK ); procedure ADA_THD_LOCK_INT_LOCK( LOCK : INTERNAL_LOCK ); pragma EXPORT( C, ADA_THD_LOCK_INT_LOCK ); procedure ADA_THD_UNLOCK_INT_LOCK( LOCK : INTERNAL_LOCK ); pragma EXPORT( C, ADA_THD_UNLOCK_INT_LOCK ); -- -- task used as a condition variable for joining. -- task type INTERNAL_CV_TYPE is entry WAIT; entry WAKE_ALL; entry TIMED_WAIT( WAIT_T : in DURATION ); end INTERNAL_CV_TYPE; for INTERNAL_CV_TYPE'STORAGE_SIZE use 4000; type INTERNAL_CV is access INTERNAL_CV_TYPE; function ADA_THD_CREATE_INT_CV return INTERNAL_CV; pragma EXPORT( C, ADA_THD_CREATE_INT_CV ); procedure ADA_THD_INT_WAIT( CV : in INTERNAL_CV; MUTEX : in INTERNAL_LOCK ); pragma EXPORT( C, ADA_THD_INT_WAIT ); type TIME_SPEC is record TV_SEC : LONG; TV_NSEC : LONG; end record; type TIME_SPEC_P is access TIME_SPEC; procedure ADA_THD_INT_TIMEDWAIT( CV : in INTERNAL_CV; MUTEX : in INTERNAL_LOCK; ABSTIME : in TIME_SPEC_P ); pragma EXPORT( C, ADA_THD_INT_TIMEDWAIT ); procedure ADA_THD_INT_SIGNAL( CV : in INTERNAL_CV ); pragma EXPORT( C, ADA_THD_INT_SIGNAL ); procedure FREE is new UNCHECKED_DEALLOCATION( INTERNAL_LOCK_TYPE, INTERNAL_LOCK ); procedure FREE is new UNCHECKED_DEALLOCATION( INTERNAL_CV_TYPE, INTERNAL_CV ); function ADDRESS_TO_INTERNAL_CV is new UNCHECKED_CONVERSION( SOURCE => SYSTEM.ADDRESS, TARGET => INTERNAL_CV ); NULL_INT_CV : INTERNAL_CV := ADDRESS_TO_INTERNAL_CV( SYSTEM.NULL_ADDRESS ); function ADDRESS_TO_INTERNAL_LOCK is new UNCHECKED_CONVERSION( SOURCE => SYSTEM.ADDRESS, TARGET => INTERNAL_LOCK ); NULL_INT_LOCK : INTERNAL_LOCK := ADDRESS_TO_INTERNAL_LOCK( SYSTEM.NULL_ADDRESS ); -- -- type cma_t_handle -- -- typedef struct CMA_T_HANDLE { -- cma_t_address field1; -- short int field2; -- short int field3; -- } cma_t_handle; -- -- typedef cma_t_handle cma_t_attr; -- typedef cma_t_attr pthread_attr_t; -- subtype CMA_T_ADDRESS is SYSTEM.ADDRESS; subtype PTHREAD_STARTROUTINE_T is SYSTEM.ADDRESS; subtype PTHREAD_CLEANUP_T is SYSTEM.ADDRESS; subtype PTHREAD_DESTRUCTOR_T is SYSTEM.ADDRESS; subtype PTHREAD_KEY_T is C_INTEGER; subtype PTHREAD_ADDR_T is SYSTEM.ADDRESS; function INT_TO_PTHREAD_ADDR_T is new UNCHECKED_CONVERSION( SOURCE => INTEGER, TARGET => PTHREAD_ADDR_T ); NULL_EXIT_STATUS : PTHREAD_ADDR_T := INT_TO_PTHREAD_ADDR_T( 0 ); function ADDRESS_TO_CMA_T_ADDRESS is new UNCHECKED_CONVERSION( SOURCE => SYSTEM.ADDRESS, TARGET => CMA_T_ADDRESS ); NULL_CMA_T_ADDRESS : CMA_T_ADDRESS := ADDRESS_TO_CMA_T_ADDRESS( SYSTEM.NULL_ADDRESS ); -- -- A "cma_t_handle" will be passed in from C. The first field contains -- a "ADA_PTHREAD_T" or "ADA_PTHREAD_MUTEX_T", etc pointer. This is -- required since some DCE calls pass a "pthread_t_" by value. In Ada, -- the "ADA_PTHREAD_*_T" structure is what is manipulated. -- type CMA_T_HANDLE is record FIELD1 : CMA_T_ADDRESS := NULL_CMA_T_ADDRESS; FIELD2 : SHORT := 0; FIELD3 : SHORT := 0; end record; type PTHREAD_T is access CMA_T_HANDLE; type PTHREAD_ATTR_T is access CMA_T_HANDLE; type PTHREAD_MUTEX_T is access CMA_T_HANDLE; type PTHREAD_MUTEXATTR_T is access CMA_T_HANDLE; type PTHREAD_COND_T is access CMA_T_HANDLE; type PTHREAD_CONDATTR_T is access CMA_T_HANDLE; -- -- Passing a C structure to Ada is done by reference. "pthread_create()" -- has "pthread_attr_t" as its first parameter and it is passed by -- value. "pthread_attr_t" is typedef'd as cma_t_handle. In Ada -- "pthread_attr_t" is a pointer to CMA_T_HANDLE. -- type CANCEL_STATE is ( CANCEL_OFF, CANCEL_ON ); type THREAD_STATE_T is ( UNKNOWN, RUNNING, CANCELLED, EXITED ); type CMA_THREAD_TASK_TYPE; type CMA_THREAD_TYPE is access CMA_THREAD_TASK_TYPE; function ADDRESS_TO_THREAD is new UNCHECKED_CONVERSION( SOURCE => SYSTEM.ADDRESS, TARGET => CMA_THREAD_TYPE ); function THREAD_TO_ADDRESS is new UNCHECKED_CONVERSION( SOURCE => CMA_THREAD_TYPE, TARGET => SYSTEM.ADDRESS ); function INT_TO_THREAD is new UNCHECKED_CONVERSION( INTEGER, CMA_THREAD_TYPE ); NULL_THREAD : CMA_THREAD_TYPE := ADDRESS_TO_THREAD( SYSTEM.NULL_ADDRESS ); ------------------------------------------------------------------------ -- -- Mutexes -- ------------------------------------------------------------------------ type MUTEX_KIND_T is ( MUTEX_FAST_NP, MUTEX_RECURSIVE_NP, MUTEX_NONRECURSIVE_NP ); for MUTEX_KIND_T'SIZE use C_INTEGER'SIZE; ------------------------------------------------------------------------ -- -- ADA_MUTEX_T_HANDLE is the internal representation of pthread_mutex_t. -- A pointer to the structure is stored in field1 of a pthread_mutex_t -- structure. -- -- OWNER - Current owner of the thread -- SEM - Semaphore used for mutual exclusion -- KIND - type of semaphore -- WAITERS - Indicates whether there are waiters -- on the mutex -- NEST_CNT - For recursive mutexes, indicates the -- number of times the current thread -- has sequentially locked the mutex -- LOCK - Indicates whether the mutex is locked -- EVENT - Indicates the possibility of waiters -- INT_LOCK - guards access to internal structure -- ------------------------------------------------------------------------ type MUTEX_STATE_T is ( INIT, LOCK, UNLOCK, DESTROY ); type ADA_PTHREAD_T_HANDLE; type ADA_PTHREAD_T is access ADA_PTHREAD_T_HANDLE; type ADA_MUTEX_T_HANDLE is record OWNER : ADA_PTHREAD_T; SEM : DCE_ADA_SEMAPHORE.SEMAPHORE_TYPE; KIND : MUTEX_KIND_T; STATE : MUTEX_STATE_T := INIT; WAITERS : LONG := 0; NEST_CNT : LONG := 0; LOCK : LONG := 0; EVENT : LONG := 1; INT_LOCK : INTERNAL_LOCK_TYPE; FULL_CHECKING : BOOLEAN := TRUE; end record; type ADA_PTHREAD_MUTEX_T is access ADA_MUTEX_T_HANDLE; type ADA_MUTEXATTR_REC_T is record KIND : MUTEX_KIND_T := MUTEX_FAST_NP; FULL_CHECKING : BOOLEAN := TRUE; end record; type ADA_MUTEXATTR_T is access ADA_MUTEXATTR_REC_T; function GET_ADA_MUTEXATTR( ATTR : in PTHREAD_MUTEXATTR_T ) return ADA_MUTEXATTR_T; procedure FREE is new UNCHECKED_DEALLOCATION( ADA_MUTEX_T_HANDLE, ADA_PTHREAD_MUTEX_T ); procedure FREE is new UNCHECKED_DEALLOCATION( ADA_MUTEXATTR_REC_T, ADA_MUTEXATTR_T ); function CMA_T_ADDRESS_TO_ADA_PTHREAD_MUTEX_T is new UNCHECKED_CONVERSION( CMA_T_ADDRESS, ADA_PTHREAD_MUTEX_T ); function ADA_PTHREAD_MUTEX_T_TO_CMA_T_ADDRESS is new UNCHECKED_CONVERSION( ADA_PTHREAD_MUTEX_T, CMA_T_ADDRESS ); function CMA_T_ADDRESS_TO_ADA_MUTEXATTR_T is new UNCHECKED_CONVERSION( CMA_T_ADDRESS, ADA_MUTEXATTR_T ); function ADA_MUTEXATTR_T_TO_CMA_T_ADDRESS is new UNCHECKED_CONVERSION( ADA_MUTEXATTR_T, CMA_T_ADDRESS ); function ADDRESS_TO_ADA_MUTEXATTR_T is new UNCHECKED_CONVERSION( SYSTEM.ADDRESS, ADA_MUTEXATTR_T ); function ADA_MUTEXATTR_T_TO_ADDRESS is new UNCHECKED_CONVERSION( ADA_MUTEXATTR_T, SYSTEM.ADDRESS ); function ADDRESS_TO_ADA_PTHREAD_MUTEX_T is new UNCHECKED_CONVERSION( SYSTEM.ADDRESS, ADA_PTHREAD_MUTEX_T ); NULL_ADA_PTHREAD_MUTEX_T : ADA_PTHREAD_MUTEX_T := ADDRESS_TO_ADA_PTHREAD_MUTEX_T( SYSTEM.NULL_ADDRESS ); NULL_ADA_MUTEXATTR_T : ADA_MUTEXATTR_T := ADDRESS_TO_ADA_MUTEXATTR_T( SYSTEM.NULL_ADDRESS ); function INT_TO_ADA_MUTEXATTR_T is new UNCHECKED_CONVERSION( INTEGER, ADA_MUTEXATTR_T ); MUTEXATTR_DEFAULT : ADA_MUTEXATTR_T := INT_TO_ADA_MUTEXATTR_T( -1 ); ------------------------------------------------------------------------ -- -- ADA_PTHREAD_T_HANDLE is the internal representation of a task. It is -- what is returned in the first field of "pthread_t". Global lists -- are maintained for all threads created. One is used to retrieve -- an ADA_PTHREAD_T_HANDLE from the current TCB. The other is a master -- list of ADA_PTHREAD_T_HANDLEs -- -- TASK_ID - task executing "thread" routine -- EXIT_STATUS - status passed into "pthread_exit()" -- STATE - state of the current task -- DETACHED - whether thread has been detached -- GENERAL_CANCEL - general cancelability state -- ASYNC_CANCEL - async cancelability state -- JOIN_CNT - number of current joiners -- ERRNO - errno value for thread -- CLEANUP_HNDLRS - number of cleanup handlers registered -- for the thread -- KEY_LIST - list of key data for thread -- CMA_THREAD_TCB - pthread cma TCB allocated for the -- thread. This is used for exception -- handling. -- TCB_PTR - the task's current TCB. -- INT_LOCK - used to sequence examination/changes -- to internal data structures -- JOIN_CV - used for joining and for pthread_ -- delay_np(). Joiners wait on -- the target thread's "JOIN_CV". The -- target thread broadcasts to it's INT_ -- CV after it exits. -- JOIN_TGT - the thread that we're trying to join -- with (i.e., the target thread) -- ------------------------------------------------------------------------ type ADA_COND_T_HANDLE; type ADA_PTHREAD_COND_T is access ADA_COND_T_HANDLE; function ADDRESS_TO_ADA_PTHREAD_COND_T is new UNCHECKED_CONVERSION( SYSTEM.ADDRESS, ADA_PTHREAD_COND_T ); NULL_ADA_PTHREAD_COND_T : ADA_PTHREAD_COND_T := ADDRESS_TO_ADA_PTHREAD_COND_T( SYSTEM.NULL_ADDRESS ); function ADDRESS_TO_ADA_PTHREAD_T is new UNCHECKED_CONVERSION( SOURCE => SYSTEM.ADDRESS, TARGET => ADA_PTHREAD_T ); function ADA_PTHREAD_T_TO_ADDRESS is new UNCHECKED_CONVERSION( SOURCE => ADA_PTHREAD_T, TARGET => SYSTEM.ADDRESS ); NULL_ADA_PTHREAD_T : ADA_PTHREAD_T := ADDRESS_TO_ADA_PTHREAD_T( SYSTEM.NULL_ADDRESS ); type ADA_PTHREAD_T_HANDLE is record TASK_ID : CMA_THREAD_TYPE := NULL_THREAD; TCB_PTR : SYSTEM.ADDRESS := SYSTEM.NULL_ADDRESS; EXIT_STATUS : PTHREAD_ADDR_T := NULL_EXIT_STATUS; STATE : THREAD_STATE_T := RUNNING; DETACHED : BOOLEAN := FALSE; GENERAL_CANCEL : CANCEL_STATE := CANCEL_ON; ASYNC_CANCEL : CANCEL_STATE := CANCEL_OFF; JOIN_CNT : INTEGER := 0; ERRNO : C_INTEGER := 0; CLEANUP_HNDLRS : C_INTEGER := 0; KEY_LIST : SYSTEM.ADDRESS := SYSTEM.NULL_ADDRESS; CMA_THREAD_TCB : SYSTEM.ADDRESS := SYSTEM.NULL_ADDRESS; INT_LOCK : INTERNAL_LOCK_TYPE; WAIT_MUTEX : INTERNAL_LOCK; WAIT_CV : INTERNAL_CV := NULL_INT_CV; JOIN_CV : INTERNAL_CV := NULL_INT_CV; CV : ADA_PTHREAD_COND_T := NULL_ADA_PTHREAD_COND_T; SCHEDULER : C_INTEGER := 0; PRIORITY : C_INTEGER := 0; UNIQUE_ID : C_INTEGER := 0; JOIN_TGT : ADA_PTHREAD_T := NULL_ADA_PTHREAD_T; EXECUTING_DELAY : BOOLEAN := FALSE; SELECT_WAIT : BOOLEAN := FALSE; end record; type INHERIT_SCHED_T is ( PTHREAD_INHERIT_SCHED, PTHREAD_DEFAULT_SCHED ); for INHERIT_SCHED_T'SIZE use C_INTEGER'SIZE; -- same as C_INTEGER; function C_INTEGER_TO_INHERIT_SCHED_T is new UNCHECKED_CONVERSION( C_INTEGER, INHERIT_SCHED_T ); type PTHREAD_SCHED_T is ( SCHED_FIFO, SCHED_RR, SCHED_OTHER, SCHED_FG_NP, SCHED_BG_NP ); for PTHREAD_SCHED_T'SIZE use C_INTEGER'SIZE; -- same as C_INTEGER; function C_INTEGER_TO_PTHREAD_SCHED_T is new UNCHECKED_CONVERSION( C_INTEGER, PTHREAD_SCHED_T ); type ADA_PTHREAD_ATTR_REC_T is record INHERIT : C_INTEGER := 0; STACK_SIZE : LONG := 0; PRIORITY : C_INTEGER := 0; SCHED : C_INTEGER := 0; end record; type ADA_PTHREAD_ATTR_T is access ADA_PTHREAD_ATTR_REC_T; function ADDRESS_TO_ADA_PTHREAD_ATTR_T is new UNCHECKED_CONVERSION( SOURCE => SYSTEM.ADDRESS, TARGET => ADA_PTHREAD_ATTR_T ); function ADA_PTHREAD_ATTR_T_TO_ADDRESS is new UNCHECKED_CONVERSION( SOURCE => ADA_PTHREAD_ATTR_T, TARGET => SYSTEM.ADDRESS ); NULL_ADA_PTHREAD_ATTR_T : ADA_PTHREAD_ATTR_T := ADDRESS_TO_ADA_PTHREAD_ATTR_T( SYSTEM.NULL_ADDRESS ); function INT_TO_ADA_PTHREAD_ATTR_T is new UNCHECKED_CONVERSION( INTEGER, ADA_PTHREAD_ATTR_T ); PTHREADATTR_DEFAULT : ADA_PTHREAD_ATTR_T := INT_TO_ADA_PTHREAD_ATTR_T( -1 ); function GET_ADA_PTHREAD_ATTR( ATTR : in CMA_TYPES.PTHREAD_ATTR_T ) return ADA_PTHREAD_ATTR_T; function CREATE_MAIN_TASK return ADA_PTHREAD_T; procedure FREE_ADA_PTHREAD_T( HANDLE : in ADA_PTHREAD_T ); ------------------------------------------------------------------------ -- -- This is the task created to execute the thread routine. -- ------------------------------------------------------------------------ task type CMA_THREAD_TASK_TYPE is entry START( HANDLE : in ADA_PTHREAD_T; START_FUNC : in PTHREAD_STARTROUTINE_T; ARG : in PTHREAD_ADDR_T ); -- entry JOIN; end CMA_THREAD_TASK_TYPE; procedure FREE is new UNCHECKED_DEALLOCATION( CMA_THREAD_TASK_TYPE, CMA_THREAD_TYPE ); procedure FREE is new UNCHECKED_DEALLOCATION( ADA_PTHREAD_ATTR_REC_T, ADA_PTHREAD_ATTR_T ); function ADA_PTHREAD_ATTR_T_TO_CMA_T_ADDRESS is new UNCHECKED_CONVERSION( SOURCE => ADA_PTHREAD_ATTR_T, TARGET => CMA_T_ADDRESS ); function CMA_T_ADDRESS_TO_ADA_PTHREAD_ATTR_T is new UNCHECKED_CONVERSION( SOURCE => CMA_T_ADDRESS, TARGET => ADA_PTHREAD_ATTR_T ); function ADA_PTHREAD_T_TO_CMA_T_ADDRESS is new UNCHECKED_CONVERSION( SOURCE => ADA_PTHREAD_T, TARGET => CMA_T_ADDRESS ); function CMA_T_ADDRESS_TO_ADA_PTHREAD_T is new UNCHECKED_CONVERSION( SOURCE => CMA_T_ADDRESS, TARGET => ADA_PTHREAD_T ); function INTEGER_TO_ADDRESS is new UNCHECKED_CONVERSION( SOURCE => INTEGER, TARGET => SYSTEM.ADDRESS ); function ADDRESS_TO_INTEGER is new UNCHECKED_CONVERSION( SOURCE => SYSTEM.ADDRESS, TARGET => INTEGER ); function PTHREAD_ADDR_T_TO_ADDRESS is new UNCHECKED_CONVERSION( SOURCE => PTHREAD_ADDR_T, TARGET => SYSTEM.ADDRESS ); procedure FREE is new UNCHECKED_DEALLOCATION( ADA_PTHREAD_T_HANDLE, ADA_PTHREAD_T ); ------------------------------------------------------------------------ -- -- Condition Variables -- ------------------------------------------------------------------------ type ADA_COND_T_HANDLE is record OWNER : ADA_PTHREAD_T := NULL_ADA_PTHREAD_T; SEM : DCE_ADA_SEMAPHORE.SEMAPHORE_TYPE; LOCK_CNT : INTEGER := 0; MUTEX : ADA_PTHREAD_MUTEX_T := NULL_ADA_PTHREAD_MUTEX_T; INT_LOCK : INTERNAL_LOCK_TYPE; end record; type ADA_CONDATTR_REC_T is record FIELD1 : INTEGER := 0; end record; type ADA_CONDATTR_T is access ADA_CONDATTR_REC_T; function GET_ADA_COND_ATTR( ATTR : in PTHREAD_CONDATTR_T ) return ADA_CONDATTR_T; procedure FREE is new UNCHECKED_DEALLOCATION( ADA_COND_T_HANDLE, ADA_PTHREAD_COND_T ); procedure FREE is new UNCHECKED_DEALLOCATION( ADA_CONDATTR_REC_T, ADA_CONDATTR_T ); function CMA_T_ADDRESS_TO_ADA_PTHREAD_COND_T is new UNCHECKED_CONVERSION( CMA_T_ADDRESS, ADA_PTHREAD_COND_T ); function ADA_PTHREAD_COND_T_TO_CMA_T_ADDRESS is new UNCHECKED_CONVERSION( ADA_PTHREAD_COND_T, CMA_T_ADDRESS ); function CMA_T_ADDRESS_TO_ADA_CONDATTR_T is new UNCHECKED_CONVERSION( CMA_T_ADDRESS, ADA_CONDATTR_T ); function ADA_CONDATTR_T_TO_CMA_T_ADDRESS is new UNCHECKED_CONVERSION( ADA_CONDATTR_T, CMA_T_ADDRESS ); function ADDRESS_TO_ADA_CONDATTR_T is new UNCHECKED_CONVERSION( SYSTEM.ADDRESS, ADA_CONDATTR_T ); function ADA_CONDATTR_T_TO_ADDRESS is new UNCHECKED_CONVERSION( ADA_CONDATTR_T, SYSTEM.ADDRESS ); NULL_ADA_CONDATTR_T : ADA_CONDATTR_T := ADDRESS_TO_ADA_CONDATTR_T( SYSTEM.NULL_ADDRESS ); function INT_TO_ADA_CONDATTR_T is new UNCHECKED_CONVERSION( INTEGER, ADA_CONDATTR_T ); CONDATTR_DEFAULT : ADA_CONDATTR_T := INT_TO_ADA_CONDATTR_T( -1 ); -- -- -- function GET_ADA_THREAD_HANDLE( PTHREAD : in PTHREAD_T ) return ADA_PTHREAD_T; function GET_ADA_MUTEX_HANDLE( PMUTEX : in PTHREAD_MUTEX_T ) return ADA_PTHREAD_MUTEX_T; function GET_ADA_COND_HANDLE( PCOND : in PTHREAD_COND_T ) return ADA_PTHREAD_COND_T; function ADA_THD_IS_HANDLE_VALID( PTHREAD : in CMA_TYPES.PTHREAD_T; EXISTS : in CMA_TYPES.C_INTEGER_P ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_THD_IS_HANDLE_VALID ); function ADA_THD_GET_TASK_TCB_PTR return SYSTEM.ADDRESS; pragma INTERFACE( C, ADA_THD_GET_TASK_TCB_PTR ); DEBUG_FLAG : BOOLEAN := TRUE; ADA_CURRENT_THREAD_TCB : ADA_PTHREAD_T := NULL_ADA_PTHREAD_T; end CMA_TYPES;