----------------------------------------------------------------------- -- Howard Eng 2/94-- -- Unixpros, Inc. -- -- -- -- This package defines the implementation of "pthread_" using Ada -- ----------------------------------------------------------------------- with UNCHECKED_CONVERSION; with UNCHECKED_DEALLOCATION; with SYSTEM; with CMA_TYPES; with DCE_ADA_SEMAPHORE; with DCE_ADA_SIGNAL; package DCE_THREADS is procedure ADA_DCE_TASK_REGISTER; procedure PTHREAD_YIELD; pragma INTERFACE( C, PTHREAD_YIELD ); function PTHREAD_ATTR_SETSCHED( ATTR : in CMA_TYPES.PTHREAD_ATTR_T; SCHED : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_ATTR_SETSCHED ); function PTHREAD_ATTR_SETPRIO( ATTR : in CMA_TYPES.PTHREAD_ATTR_T; PRIORITY : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_ATTR_SETPRIO ); function PTHREAD_ATTR_DELETE( ATTR : in CMA_TYPES.PTHREAD_ATTR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_ATTR_DELETE ); function PTHREAD_MUTEXATTR_DELETE( ATTR : in CMA_TYPES.PTHREAD_MUTEXATTR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_MUTEXATTR_DELETE ); function PTHREAD_MUTEXATTR_SETKIND_NP( ATTR : in CMA_TYPES.PTHREAD_MUTEXATTR_T; KIND : in CMA_TYPES.MUTEX_KIND_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_MUTEXATTR_SETKIND_NP ); function PTHREAD_CONDATTR_DELETE( ATTR : in CMA_TYPES.PTHREAD_CONDATTR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_CONDATTR_DELETE ); function PTHREAD_COND_INIT( PCOND : in CMA_TYPES.PTHREAD_COND_T; ATTR : in CMA_TYPES.PTHREAD_CONDATTR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_COND_INIT ); function PTHREAD_COND_WAIT( PCOND : in CMA_TYPES.PTHREAD_COND_T; PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_COND_WAIT ); function PTHREAD_COND_TIMEDWAIT( PCOND : in CMA_TYPES.PTHREAD_COND_T; PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T; ABSTIME : in CMA_TYPES.TIME_SPEC_P ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_COND_TIMEDWAIT ); function PTHREAD_COND_SIGNAL( PCOND : in CMA_TYPES.PTHREAD_COND_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_COND_SIGNAL ); function PTHREAD_COND_BROADCAST( PCOND : in CMA_TYPES.PTHREAD_COND_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_COND_BROADCAST ); function PTHREAD_CREATE( PTHREAD : in CMA_TYPES.PTHREAD_T; ATTR : in CMA_TYPES.PTHREAD_ATTR_T; START : in CMA_TYPES.PTHREAD_STARTROUTINE_T; ARG : in CMA_TYPES.PTHREAD_ADDR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_CREATE ); function PTHREAD_ATTR_CREATE( ATTR : in CMA_TYPES.PTHREAD_ATTR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_ATTR_CREATE ); function PTHREAD_ATTR_SETSTACKSIZE( ATTR : in CMA_TYPES.PTHREAD_ATTR_T; STACKSIZE : in CMA_TYPES.LONG ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_ATTR_SETSTACKSIZE ); function PTHREAD_MUTEXATTR_CREATE( ATTR : in CMA_TYPES.PTHREAD_MUTEXATTR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_MUTEXATTR_CREATE ); function PTHREAD_CONDATTR_CREATE( ATTR : in CMA_TYPES.PTHREAD_CONDATTR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_CONDATTR_CREATE ); function PTHREAD_DETACH( PTHREAD : in CMA_TYPES.PTHREAD_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_DETACH ); function PTHREAD_CANCEL( PTHREAD : in CMA_TYPES.PTHREAD_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_CANCEL ); function PTHREAD_DELAY_NP( INTERVAL : in CMA_TYPES.TIME_SPEC_P ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_DELAY_NP ); -- function PTHREAD_SELF -- return CMA_TYPES.CMA_T_HANDLE; -- pragma INTERFACE( C, PTHREAD_SELF ); function PTHREAD_EQUAL( PTHREAD1 : in CMA_TYPES.PTHREAD_T; PTHREAD2 : in CMA_TYPES.PTHREAD_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_EQUAL ); -- function PTHREAD_GETSPECIFIC( -- KEY : in CMA_TYPES.PTHREAD_KEY_T; -- VALUE : out CMA_TYPES.PTHREAD_ADDR_T -- ) return CMA_TYPES.C_INTEGER; -- pragma INTERFACE( C, PTHREAD_GETSPECIFIC ); function PTHREAD_SETSPECIFIC( KEY : in CMA_TYPES.PTHREAD_KEY_T; VALUE : in CMA_TYPES.PTHREAD_ADDR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_SETSPECIFIC ); function PTHREAD_SETCANCEL( STATE : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_SETCANCEL ); function PTHREAD_SETASYNCCANCEL( STATE : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_SETASYNCCANCEL ); function PTHREAD_KEYCREATE( KEY : in CMA_TYPES.PTHREAD_KEY_T; DESTRUCTOR : in CMA_TYPES.PTHREAD_DESTRUCTOR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_KEYCREATE ); procedure PTHREAD_EXIT( STATUS : in CMA_TYPES.PTHREAD_ADDR_T ); pragma INTERFACE( C, PTHREAD_EXIT ); procedure PTHREAD_JOIN( PTHREAD : in CMA_TYPES.PTHREAD_T; STATUS : in CMA_TYPES.PTHREAD_ADDR_T ); pragma INTERFACE( C, PTHREAD_JOIN ); procedure PTHREAD_CLEANUP_PUSH( ROUTINE : in CMA_TYPES.PTHREAD_CLEANUP_T; ARG : in CMA_TYPES.PTHREAD_ADDR_T ); pragma INTERFACE( C, PTHREAD_CLEANUP_PUSH ); procedure PTHREAD_CLEANUP_POP( EXECUTE : in CMA_TYPES.C_INTEGER ); pragma INTERFACE( C, PTHREAD_CLEANUP_POP ); function PTHREAD_MUTEX_INIT( PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T; ATTR : in CMA_TYPES.PTHREAD_MUTEXATTR_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_MUTEX_INIT ); function PTHREAD_MUTEX_LOCK( PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_MUTEX_LOCK ); function PTHREAD_MUTEX_UNLOCK( PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_MUTEX_UNLOCK ); function PTHREAD_MUTEX_TRYLOCK( PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_MUTEX_TRYLOCK ); function PTHREAD_MUTEX_DESTROY( PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_MUTEX_DESTROY ); function PTHREAD_COND_DESTROY( PCOND : in CMA_TYPES.PTHREAD_COND_T ) return CMA_TYPES.C_INTEGER; pragma INTERFACE( C, PTHREAD_COND_DESTROY ); private function ADA_THD_IS_KEY_VALID( KEY : in CMA_TYPES.PTHREAD_KEY_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_THD_IS_KEY_VALID ); procedure ADA_PTHREAD_YIELD; pragma EXPORT( C, ADA_PTHREAD_YIELD ); function ADA_PTHREAD_ATTR_SETSCHED( ATTR : in CMA_TYPES.PTHREAD_ATTR_T; SCHED : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_ATTR_SETSCHED ); function ADA_PTHREAD_ATTR_SETPRIO( ATTR : in CMA_TYPES.PTHREAD_ATTR_T; PRIORITY : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_ATTR_SETPRIO ); function ADA_PTHREAD_ATTR_DELETE( ATTR : in CMA_TYPES.PTHREAD_ATTR_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_ATTR_DELETE ); function ADA_PTHREAD_MUTEXATTR_DELETE( ATTR : in CMA_TYPES.PTHREAD_MUTEXATTR_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_MUTEXATTR_DELETE ); function ADA_PTHREAD_CONDATTR_DELETE( ATTR : in CMA_TYPES.PTHREAD_CONDATTR_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_CONDATTR_DELETE ); procedure ADA_PTHREAD_COND_INIT( PCOND : in CMA_TYPES.PTHREAD_COND_T; ATTR : in CMA_TYPES.PTHREAD_CONDATTR_T ); pragma EXPORT( C, ADA_PTHREAD_COND_INIT ); function ADA_PTHREAD_COND_SIGNAL( PCOND : in CMA_TYPES.PTHREAD_COND_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_COND_SIGNAL ); function ADA_PTHREAD_COND_BROADCAST( PCOND : in CMA_TYPES.PTHREAD_COND_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_COND_BROADCAST ); function ADA_PTHREAD_COND_WAIT( PCOND : in CMA_TYPES.PTHREAD_COND_T; PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_COND_WAIT ); function ADA_PTHREAD_COND_TIMEDWAIT( PCOND : in CMA_TYPES.PTHREAD_COND_T; PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T; ABSTIME : in CMA_TYPES.TIME_SPEC_P ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_COND_TIMEDWAIT ); procedure ADA_PTHREAD_MUTEX_INIT( PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T; ATTR : in CMA_TYPES.PTHREAD_MUTEXATTR_T ); pragma EXPORT( C, ADA_PTHREAD_MUTEX_INIT ); function ADA_PTHREAD_GETSPECIFIC( KEY : in CMA_TYPES.PTHREAD_KEY_T ) return CMA_TYPES.PTHREAD_ADDR_T; pragma EXPORT( C, ADA_PTHREAD_GETSPECIFIC ); function ADA_PTHREAD_JOIN( PTHREAD : in CMA_TYPES.PTHREAD_T; STATUS : in CMA_TYPES.C_INTEGER_P ) return CMA_TYPES.PTHREAD_ADDR_T; pragma EXPORT( C, ADA_PTHREAD_JOIN ); procedure ADA_PTHREAD_CREATE( PTHREAD : in CMA_TYPES.PTHREAD_T; ATTR : in CMA_TYPES.PTHREAD_ATTR_T; START_ROUTINE : in CMA_TYPES.PTHREAD_STARTROUTINE_T; ARG : in CMA_TYPES.PTHREAD_ADDR_T ); pragma EXPORT( C, ADA_PTHREAD_CREATE ); procedure ADA_PTHREAD_ATTR_CREATE( ATTR : in CMA_TYPES.PTHREAD_ATTR_T ); pragma EXPORT( C, ADA_PTHREAD_ATTR_CREATE ); function ADA_PTHREAD_MUTEXATTR_CREATE( ATTR : in CMA_TYPES.PTHREAD_MUTEXATTR_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_MUTEXATTR_CREATE ); function ADA_PTHREAD_MUTEXATTR_SETKIND_NP( ATTR : in CMA_TYPES.PTHREAD_MUTEXATTR_T; KIND : in CMA_TYPES.MUTEX_KIND_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_MUTEXATTR_SETKIND_NP ); function ADA_PTHREAD_CONDATTR_CREATE( ATTR : in CMA_TYPES.PTHREAD_CONDATTR_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_CONDATTR_CREATE ); function ADA_PTHREAD_ATTR_SETSTACKSIZE( ATTR : in CMA_TYPES.PTHREAD_ATTR_T; STACKSIZE : in CMA_TYPES.LONG ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_ATTR_SETSTACKSIZE ); function ADA_PTHREAD_ATTR_SETINHERITSCHED( ATTR : in CMA_TYPES.PTHREAD_ATTR_T; SETINHERIT : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_ATTR_SETINHERITSCHED ); function ADA_PTHREAD_CANCEL( PTHREAD : in CMA_TYPES.PTHREAD_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_CANCEL ); procedure ADA_PTHREAD_KEYCREATE( KEY : in CMA_TYPES.PTHREAD_KEY_T; DESTRUCTOR : in CMA_TYPES.PTHREAD_DESTRUCTOR_T ); pragma EXPORT( C, ADA_PTHREAD_KEYCREATE ); procedure ADA_PTHREAD_SETSPECIFIC( KEY : in CMA_TYPES.PTHREAD_KEY_T; VALUE : in CMA_TYPES.PTHREAD_ADDR_T ); pragma EXPORT( C, ADA_PTHREAD_SETSPECIFIC ); function ADA_PTHREAD_DETACH( PTHREAD : in CMA_TYPES.PTHREAD_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_DETACH ); procedure ADA_PTHREAD_EXIT( EXIT_STATUS : in CMA_TYPES.PTHREAD_ADDR_T ); pragma EXPORT( C, ADA_PTHREAD_EXIT ); procedure ADA_PTHREAD_DELAY_NP( INTERVAL : in CMA_TYPES.TIME_SPEC_P ); pragma EXPORT( C, ADA_PTHREAD_DELAY_NP ); procedure ADA_PTHREAD_TESTCANCEL; pragma EXPORT( C, ADA_PTHREAD_TESTCANCEL ); function ADA_PTHREAD_EQUAL( PTHREAD1 : in CMA_TYPES.PTHREAD_T; PTHREAD2 : in CMA_TYPES.PTHREAD_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_EQUAL ); function ADA_PTHREAD_SELF return CMA_TYPES.ADA_PTHREAD_T; pragma EXPORT( C, ADA_PTHREAD_SELF ); function ADA_PTHREAD_SETCANCEL( STATE : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_SETCANCEL ); function ADA_PTHREAD_SETASYNCCANCEL( STATE : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_SETASYNCCANCEL ); function ADA_PTHREAD_MUTEX_DESTROY( PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_MUTEX_DESTROY ); function ADA_PTHREAD_COND_DESTROY( PCOND : in CMA_TYPES.PTHREAD_COND_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_COND_DESTROY ); function ADA_PTHREAD_MUTEX_LOCK( PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_MUTEX_LOCK ); function ADA_PTHREAD_MUTEX_UNLOCK( PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_MUTEX_UNLOCK ); function ADA_PTHREAD_MUTEX_TRYLOCK( PMUTEX : in CMA_TYPES.PTHREAD_MUTEX_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_MUTEX_TRYLOCK ); function ADA_GET_SELF_CMA_TCB return SYSTEM.ADDRESS; pragma EXPORT( C, ADA_GET_SELF_CMA_TCB ); function ADA_THREAD_HANDLER_COUNT return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_THREAD_HANDLER_COUNT ); function ADA_THD_SET_ERRNO( ERRNO : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_THD_SET_ERRNO ); function ADA_PTHREAD_MUTEXATTR_DISABLECHECKS_NP( ATTR : in CMA_TYPES.PTHREAD_MUTEXATTR_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_MUTEXATTR_DISABLECHECKS_NP ); function ADA_GET_EXIT_STATUS return CMA_TYPES.PTHREAD_ADDR_T; pragma EXPORT( C, ADA_GET_EXIT_STATUS ); function ADA_PTHREAD_SETSCHEDULER( PTHREAD : in CMA_TYPES.PTHREAD_T; SCHEDULER : in CMA_TYPES.C_INTEGER; PRIORITY : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_SETSCHEDULER ); function ADA_PTHREAD_GETSCHEDULER( PTHREAD : in CMA_TYPES.PTHREAD_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_GETSCHEDULER ); function ADA_PTHREAD_SETPRIO( PTHREAD : in CMA_TYPES.PTHREAD_T; PRIORITY : in CMA_TYPES.C_INTEGER ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_SETPRIO ); function ADA_PTHREAD_GETPRIO( PTHREAD : in CMA_TYPES.PTHREAD_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_GETPRIO ); function ADA_PTHREAD_ATTR_GETPRIO( ATTR : in CMA_TYPES.PTHREAD_ATTR_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_ATTR_GETPRIO ); function ADA_PTHREAD_ATTR_GETSCHED( ATTR : in CMA_TYPES.PTHREAD_ATTR_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_ATTR_GETSCHED ); function ADA_PTHREAD_ATTR_GETINHERITSCHED( ATTR : in CMA_TYPES.PTHREAD_ATTR_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_ATTR_GETINHERITSCHED ); function ADA_PTHREAD_ATTR_GETSTACKSIZE( ATTR : in CMA_TYPES.PTHREAD_ATTR_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_ATTR_GETSTACKSIZE ); function ADA_PTHREAD_GETUNIQUE_NP( PTHREAD : in CMA_TYPES.PTHREAD_T ) return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_PTHREAD_GETUNIQUE_NP ); type INTERNAL_LOCK_RECORD is record OWNER : CMA_TYPES.ADA_PTHREAD_T; SEM : DCE_ADA_SEMAPHORE.SEMAPHORE_TYPE; WAITERS : CMA_TYPES.LONG := 0; NEST_CNT : CMA_TYPES.LONG := 0; LOCK : CMA_TYPES.LONG := 0; EVENT : CMA_TYPES.LONG := 1; end record; type INT_LOCK_HANDLE is access INTERNAL_LOCK_RECORD; function ADA_THD_CREATE_INT_MUTEX return INT_LOCK_HANDLE; pragma EXPORT( C, ADA_THD_CREATE_INT_MUTEX ); procedure ADA_THD_LOCK_INT_MUTEX( MUTEX : in INT_LOCK_HANDLE ); pragma EXPORT( C, ADA_THD_LOCK_INT_MUTEX ); procedure ADA_THD_UNLOCK_INT_MUTEX( MUTEX : in INT_LOCK_HANDLE ); pragma EXPORT( C, ADA_THD_UNLOCK_INT_MUTEX ); function ADA_THD_GET_CMA_TCB( HANDLE : CMA_TYPES.ADA_PTHREAD_T ) return SYSTEM.ADDRESS; pragma EXPORT( C, ADA_THD_GET_CMA_TCB ); procedure ADA_THD_SET_SELECT_STATE( STATE : in CMA_TYPES.C_INTEGER ); pragma EXPORT( C, ADA_THD_SET_SELECT_STATE ); function ADA_THD_CANCELLED return CMA_TYPES.C_INTEGER; pragma EXPORT( C, ADA_THD_CANCELLED ); end DCE_THREADS;