[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


E.4 cma Exceptions

Table E-1 lists the cma exceptions and gives an explanation of each. It also contains the recommended action you should take if an exception occurs.

Table E-1 cma Exceptions



Exception        Explanation and User Action

cma_e_alerted    Thread execution was alerted


                 Explanation: A thread was requested to terminate
                 by either the cma_thread_alert or pthread_cancel
                 routine. DECthreads uses an alert to request that a
                 thread terminate after first performing cleanup and
                 shutdown operations.


                 User Action: If you do not want threads to
                 terminate at the point where this alert is being
                 delivered, you can use several routines (cma_alert_
                 disable_general, cma_alert_disable_asynch, cma_
                 alert_restore, pthread_setcancelstate, and pthread_
                 setcanceltype) to specify points in the thread
                 process where alerts cannot be delivered to the
                 thread.


cma_e_alert_     Improper nesting of alert scope
nesting


                 Explanation: An attempt was made to restore an
                 inner scope after an enclosing outer scope had
                 already been restored.


                 User Action: Examine the code to determine where
                 the incorrect alert state variable was passed to
                 the cma_alert_restore routine.


cma_e_badparam   Parameter to DECthreads operation is invalid


                 Explanation: A parameter passed to a DECthreads
                 routine is improper; for example, the value is of
                 the wrong type or is out of range.


                 User Action: Determine which routine raised
                 the exception. Then consult the documentation
                 to determine the correct parameters and value
                 ranges. Update your code accordingly and retry
                 the operation.


                 If you continue to have problems, report it to
                 Digital, including a small test program that
                 reproduces the problem.


cma_e_existence  Object referenced does not currently exist


                 Explanation: A DECthreads routine was requested to
                 operate on an object that does not exist.


                 User Action: Consult the documentation for the
                 DECthreads routine that issued this message to
                 determine the conditions that caused it. Also check
                 the program where the call is issued to determine
                 which object or objects that are being passed as
                 parameters do not currently exist.


cma_e_exit_      Current thread was requested to exit
thread


                 Explanation: The cma_thread_exit routine was
                 called to force the thread to shut down in an
                 orderly fashion. This message notifies all active
                 exception handlers to perform any necessary cleanup
                 activities.


                 User Action: None


cma_e_inialrpro  DECthreads initialization is already in progress


                 Explanation: A call was made to the DECthreads
                 initialization routine cma_init while DECthreads
                 was still trying to initialize itself on a prior
                 call. DECthreads initialization must be complete
                 before any DECthreads routines are used. Once
                 DECthreads is fully initialized, all calls to cma_
                 init complete successfully.


                 User Action: Remove the offending concurrent call
                 to the cma_init routine or delay it until the first
                 call to cma_init has completed.


cma_e_in_use     Object referenced is already in use


                 Explanation: The DECthreads operation cannot be
                 performed on the specified object because it
                 is already in use; for example, the routine is
                 attempting to delete a mutex that is locked.


                 User Action: Determine which routine caused the
                 error and make sure the object is in an appropriate
                 state before attempting the operation.


cma_e_           No space is currently available to create a new
nostackmem       stack


                 Explanation: A call to cma_thread_create or another
                 DECthreads routine requires that a new stack be
                 created, but there is insufficient space to create
                 it.


                 User Action: Reduce the size of thread stacks
                 previously created, so that additional stacks may
                 be created. Alternatively, adjust system or user
                 quotas to allow the allocation of more virtual
                 memory.




cma_e_stackovf   Attempted stack overflow was detected


                 Explanation: A thread overflowed its stack.


                 User Action: Recreate the thread with a larger
                 stack or redesign the code to require less stack
                 space; for example, nest your calls less deeply or
                 allocate less storage on the stack.



cma_e_unimp      The specified DECthreads feature is not implemented


                 Explanation: You attempted to use a feature that
                 is not implemented in the version of DECthreads
                 that you are running. This error can occur when
                 a program developed on a system running a higher
                 version of DECthreads is executed on a system that
                 is running a lower version of DECthreads.


                 User Action: Use a higher version of DECthreads
                 that supports the feature or do not attempt to use
                 the feature with a lower version of DECthreads.


cma_e_uninitexc  Uninitialized exception raised


                 Explanation: Code using the EXC_HANDLING.H package,
                 which provides portable exceptions for the C
                 language, attempted to raise an exception that
                 has not been initialized.


                 User Action: Check the error messages to determine
                 the program location where the uninitialized
                 exception is being raised. Use the EXCEPTION_INIT
                 macro defined in the EXC_HANDLING.H package to
                 initialize the exception.


cma_e_unkstatus  Unknown exception reported


                 Explanation: A status exception was raised for
                 which DECthreads is unable to provide a meaningful
                 text translation.


                 User Action: Check the value of the status with
                 which the exception object was initialized to make
                 sure it has a proper text translation.


cma_e_use_error  Requested operation is inappropriate for the
                 specified object


                 Explanation: The state or type of an object is
                 inappropriate for the operation; for example, the
                 operation attempts to unlock a mutex that is not
                 locked.


                 User Action: Determine which routine caused the
                 error and consult the documentation to learn which
                 object states are appropriate for the routine.


cma_e_           Wrong mutex specified in condition wait
wrongmutex


                 Explanation: A thread attempted to wait for a
                 condition variable that already has at least one
                 thread waiting and that thread has specified a
                 different mutex. DECthreads requires that all
                 threads concurrently waiting for a condition
                 variable specify the same mutex.


                 User Action: Design your code so that each
                 condition variable represents a particular state
                 of shared data that is protected by a given mutex.



See Table 5-1 for a list of pthread exceptions. Most pthread exceptions correspond directly to a cma interface exception.



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]