Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ exceptions(3-thr) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

exceptions(3-thr)                                         exceptions(3-thr)

NAME
     exceptions - exception handling in DCE Threads

DESCRIPTION
     DCE Threads provides the following two ways to obtain information
     about the status of a threads routine:

     -  The routine returns a status value to the thread.

     -  The routine raises an exception.

     Before you write a multithreaded program, you must choose only one of
     the preceding two methods of receiving status. These two methods can-
     not be used together in the same code module.

     The POSIX P1003.4a (pthreads) draft standard specifies that errors be
     reported to the thread by setting the external variable errno to an
     error code and returning a function value of -1. The threads reference
     pages document this status value-returning interface. However, an
     alternative to status values is provided by DCE Threads in the
     exception-returning interface.

     Access to exceptions from the C language is defined by the macros in
     the exchandling.h file. The exchandling.h header file is included
     automatically when you include pthreadexc.h.

     To use the exception-returning interface, replace #include <pthread.h>
     with the following include statement:

          #include <dce/pthreadexc.h>

     The following example shows the syntax for handling exceptions:

     TRY
       tryblock
     [CATCH (exceptionname)
       handlerblock]...
     [CATCHALL
       handlerblock]
     ENDTRY















Page 1                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026