OSSP CVS Repository

ossp - Check-in [1707]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1707
Date: 2002-Jan-30 14:07:07 (local)
2002-Jan-30 13:07:07 (UTC)
User:rse
Branch:
Comment: Add optional support for OSSP ex based exception handling. GNU Pth (still) does not throw exceptions by itself, but handles the per-thread exception context of OSSP ex to make exception handling local to a thread.
Tickets:
Inspections:
Files:
ossp-pkg/pth/ChangeLog      1.559 -> 1.560     6 inserted, 0 deleted
ossp-pkg/pth/INSTALL      added-> 1.31
ossp-pkg/pth/acconfig.h      1.28 -> 1.29     1 inserted, 0 deleted
ossp-pkg/pth/pth_lib.c      1.47 -> 1.48     27 inserted, 0 deleted
ossp-pkg/pth/pth_p.h.in      1.29 -> 1.30     5 inserted, 0 deleted
ossp-pkg/pth/pth_tcb.c      1.37 -> 1.38     5 inserted, 0 deleted

ossp-pkg/pth/ChangeLog 1.559 -> 1.560

--- ChangeLog    2002/01/30 12:54:21     1.559
+++ ChangeLog    2002/01/30 13:07:07     1.560
@@ -19,6 +19,12 @@
     | |_ ___) |
   __|_(_)____/____________________________________________________________
 
+   *) Add optional support for OSSP ex based exception handling. GNU
+      Pth (still) does not throw exceptions by itself, but handles the
+      per-thread exception context of OSSP ex to make exception handling
+      local to a thread.
+      [Ralf S. Engelschall]
+
    *) Removed all generated files from CVS.
       Use OSSP devtool stuff to re-generate files on demand.
       Switched to Autoconf 2.52 and Libtool 1.4.2 environment.


ossp-pkg/pth/INSTALL -> 1.31

*** /dev/null    Sun Apr 28 18:11:00 2024
--- -    Sun Apr 28 18:11:33 2024
***************
*** 0 ****
--- 1,218 ----
+    ____  _   _
+   |  _ \| |_| |__                      ``All the good things you want
+   | |_) | __| '_ \                       to do in your life have to be
+   |  __/| |_| | | |                      started in the next few hours,
+   |_|    \__|_| |_|                      days or weeks.''
+                                                 -- Tom DeMarco
+   GNU Pth - The GNU Portable Threads
+ 
+   INSTALL
+   =======
+ 
+   Overview
+   --------
+ 
+   To install the Pth library into /path/to/pth/{bin,lib,include,man}/
+   perform the following steps in your shell:
+ 
+     $ ./configure
+        --prefix=/path/to/pth
+       [--enable-batch]
+       [--enable-pthread]
+       [--enable-debug]
+       [--enable-profile]
+       [--enable-optimize]
+       [--enable-maintainer]
+       [--enable-tests]
+       [--disable-shared]
+       [--disable-static]
+       [--enable-syscall-soft]
+       [--enable-syscall-hard]
+       [--with-sfio[=DIR]]
+       [--with-ex[=DIR]]
+       [--with-dmalloc[=DIR]]
+       [--with-mctx-mth=ID]
+       [--with-mctx-dsp=ID]
+       [--with-mctx-stk=ID]
+     $ make
+     $ make test
+     $ make install
+ 
+   Pth Options
+   -----------
+ 
+   The supported options have the following meaning:
+ 
+   --prefix=DIR: installation path prefix
+       This sets the path prefix of installation tree. By default this
+       prefix is /usr/local. For fine-tuning the installation paths
+       run `./configure --help' and watch for the various path related
+       options.
+ 
+   --enable-batch: build in batch mode (default=no)
+       This enables batch building. Currently this does
+       nothing more than supressing some displayed hints.
+ 
+   --enable-maintainer: build maintainer targets (default=no)
+       This enables some maintainer build targets.
+       Not for use by end users.
+ 
+   --enable-tests: build test targets (default=yes)
+       This enables the building of test targets, i.e. the various
+       test_xxx programs. If you don't want to build these use
+       --disable-tests.
+ 
+   --enable-pthread: build with pthread library (default=no)
+       This enables the building and installation of the
+       POSIX Threads ("pthread") emulation API for Pth.
+       This per default forces --enable-syscall-soft.
+ 
+   --enable-debug: build for debugging (default=no)
+       This is for debugging Pth and only interesting
+       for developers.
+ 
+   --enable-profile: build for profiling (default=no)
+       This enables profiling with gprof and is only
+       interesting for developers.
+ 
+   --enable-optimize: build with optimization (default=no)
+       This enables optimization flags, mainly for GCC.
+ 
+   --disable-static: build static libraries (default=yes)
+       This disables the building of static libraries (libxx.a).
+ 
+   --disable-shared: build shared libraries (default=yes)
+       This disables the building of shared libraries (libxx.so).
+ 
+   --enable-syscall-soft: use soft system call mapping (default=no)
+       This enables the soft system call mapping for pth.h and pthread.h
+ 
+   --enable-syscall-hard: use hard system call mapping (default=no)
+       This enables the hard system call mapping inside pth_syscall.c which
+       means that wrappers for system calls are exported by libpth.
+ 
+   --with-sfio[=DIR]
+       This can be used to enable Sfio support (see pth_sfiodisc function) for
+       Pth. The paths to the include and library file of Sfio has to be either
+       given via CFLAGS and LDFLAGS or the DIR argument has to specify the root
+       of the Sfio installation tree. Sfio can be found at
+       http://www.research.att.com/sw/tools/sfio/.
+ 
+   --with-ex[=DIR]
+       This can be used to enable OSSP ex support (exception handling)
+       for Pth. The paths to the include and library file of OSSP ex has
+       to be either given via CFLAGS and LDFLAGS or the DIR argument has
+       to specify the root of the OSSP ex installation tree. OSSP ex can
+       be found at http://www.ossp.org/pkg/ex/.
+ 
+   --with-dmalloc[=DIR]
+       This can be used to enable Dmalloc support (debugging memory
+       allocations) for Pth. The paths to the include and library file of
+       Dmalloc has to be either given via CFLAGS and LDFLAGS or the DIR
+       argument has to specify the root of the Dmalloc installation tree.
+       Dmalloc can be found at http://www.dmalloc.com/.
+ 
+   The remaining three options are really for experts only.  They force
+   particular variants for the machine context implementation.  Be carefully
+   here: Not all possibly variants of the three knobs actually work (they could
+   not work, even when we want!).
+ 
+   --with-mctx-mth=ID       [EXPERTS ONLY]
+       This forces Pth to use a particular machine context method.
+       Available variants are:
+       mcsc .... makecontext(2)/swapcontext(2)
+       sjlj .... setjmp(2)/longjmp(2)
+ 
+   --with-mctx-dsp=ID       [EXPERTS ONLY]
+       This forces Pth to use a particular machine context dispatching
+       approach. Available variants are:
+       sc ...... swapcontext(2)
+       ssjlj ... sigsetjmp(3)/siglongjmp(3)
+       sjlj .... setjmp(3)/longjmp(3) (signal mask aware)
+       usjlj ... _setjmp(3)/_longjmp(3) (signal mask aware)
+       sjlje ... setjmp(3)/longjmp(3) [emulated = plus sigprocmask(2)]
+       sjljlx .. setjmp(3)/longjmp(3), specific for anchient Linux version
+       sjljisc . setjmp(3)/longjmp(3), specific for Interactive Unix (ISC)
+       sjljw32 . setjmp(3)/longjmp(3), specific for Win32/CygWin 
+ 
+   --with-mctx-stk=ID       [EXPERTS ONLY]
+       This forces Pth to use a particular machine context stack setup
+       approach. Available variants are:
+       none .... no standard stack setup (only for some sjljXXX above)
+       mc ...... makecontext(2)
+       sas ..... sigaltstack(2)
+       ss ...... sigstack(2)
+ 
+   Compiler Flags
+   --------------
+ 
+   Some systems require unusual options for compilation or linking that the
+   `configure' script does not know about. You can give `configure' initial
+   values for variables by setting them in the environment. Using a
+   Bourne-compatible shell, you can do that on the command line like this:
+ 
+     $ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+ 
+   Or on systems that have the `env' program, you can do it like this:
+ 
+     $ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+ 
+   Compiling For Multiple Architectures
+   ------------------------------------
+ 
+   You can compile the package for more than one kind of computer at the same
+   time, by placing the object files for each architecture in their own
+   directory.  To do this, you must use a version of `make' that supports the
+   `VPATH' variable, such as GNU `make'.  `cd' to the directory where you want
+   the object files and executables to go and run the `configure' script.
+   `configure' automatically checks for the source code in the directory that
+   `configure' is in and in `..'.
+ 
+   If you have to use a `make' that does not supports the `VPATH' variable, you
+   have to compile the package for one architecture at a time in the source
+   code directory.  After you have installed the package for one architecture,
+   use `make distclean' before reconfiguring for another architecture.
+ 
+   Installation Names
+   ------------------
+ 
+   By default, `make install' will install the package's files in
+   `/usr/local/bin', `/usr/local/man', etc.  You can specify an installation
+   prefix other than `/usr/local' by giving `configure' the option
+   `--prefix=PATH'.
+ 
+   You can specify separate installation prefixes for architecture-specific
+   files and architecture-independent files.  If you give `configure' the
+   option `--exec-prefix=PATH', the package will use PATH as the prefix for
+   installing programs and libraries.  Documentation and other data files will
+   still use the regular prefix.
+ 
+   In addition, if you use an unusual directory layout you can give options
+   like `--bindir=PATH' to specify different values for particular kinds of
+   files.  Run `configure --help' for a list of the directories you can set and
+   what kinds of files go in them.
+ 
+   Specifying the System Type
+   --------------------------
+ 
+   There may be some features `configure' can not figure out automatically, but
+   needs to determine by the type of host the package will run on.  Usually
+   `configure' can figure that out, but if it prints a message saying it can
+   not guess the host type, give it the `--host=TYPE' option.  TYPE can either
+   be a short name for the system type, such as `sun4', or a canonical name
+   with three fields: CPU-COMPANY-SYSTEM
+ 
+   See the file `config.sub' for the possible values of each field.  If
+   `config.sub' isn't included in this package, then this package doesn't need
+   to know the host type.
+ 
+   Sharing Defaults
+   ----------------
+ 
+   If you want to set default values for `configure' scripts to share, you can
+   create a site shell script called `config.site' that gives default values
+   for variables like `CC', `cache_file', and `prefix'.  `configure' looks for
+   `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site'
+   if it exists.  Or, you can set the `CONFIG_SITE' environment variable to
+   the location of the site script. 
+ 


ossp-pkg/pth/acconfig.h 1.28 -> 1.29

--- acconfig.h   2002/01/27 11:03:40     1.28
+++ acconfig.h   2002/01/30 13:07:08     1.29
@@ -52,6 +52,7 @@
 #undef PTH_MCTX_STK_use
 #undef PTH_STACKGROWTH
 #undef PTH_DMALLOC
+#undef PTH_EX
 
 @BOTTOM@
 


ossp-pkg/pth/pth_lib.c 1.47 -> 1.48

--- pth_lib.c    2002/01/27 11:03:40     1.47
+++ pth_lib.c    2002/01/30 13:07:08     1.48
@@ -43,6 +43,18 @@
         pth_init();
 #endif
 
+#ifdef PTH_EX
+/* exception handling callback functions */
+static ex_ctx_t *pth_ex_ctx(void)
+{
+    return &(pth_current->ex_ctx);
+}
+static void pth_ex_terminate(ex_t *ex)
+{
+    pth_exit(ex->ex_value);
+}
+#endif
+
 /* initialize the package */
 int pth_init(void)
 {
@@ -60,6 +72,12 @@
     /* initialize the scheduler */
     pth_scheduler_init();
 
+#ifdef PTH_EX
+    /* optional support for exceptional handling */
+    __ex_ctx       = pth_ex_ctx;
+    __ex_terminate = pth_ex_terminate;
+#endif
+
     /* spawn the scheduler thread */
     t_attr = pth_attr_new();
     pth_attr_set(t_attr, PTH_ATTR_PRIO,         PTH_PRIO_MAX);
@@ -120,6 +138,10 @@
     pth_initialized = FALSE;
     pth_tcb_free(pth_sched);
     pth_tcb_free(pth_main);
+#ifdef PTH_EX
+    __ex_ctx       = __ex_ctx_default;
+    __ex_terminate = __ex_terminate_default;
+#endif
     pth_debug1("pth_kill: leave");
     return TRUE;
 }
@@ -262,6 +284,11 @@
     /* initialize mutex stuff */
     pth_ring_init(&t->mutexring);
 
+#ifdef PTH_EX
+    /* initialize exception handling context */
+    EX_CTX_INITIALIZE(&t->ex_ctx);
+#endif
+
     /* initialize the machine context of this new thread */
     if (t->stacksize > 0) { /* the "main thread" (indicated by == 0) is special! */
         if (!pth_mctx_set(&t->mctx, pth_spawn_trampoline,


ossp-pkg/pth/pth_p.h.in 1.29 -> 1.30

--- pth_p.h.in   2002/01/27 11:03:40     1.29
+++ pth_p.h.in   2002/01/30 13:07:08     1.30
@@ -70,6 +70,11 @@
 #include <dmalloc.h>
 #endif
 
+/* OSSP ex support */
+#ifdef PTH_EX
+#include "ex.h"
+#endif
+
 /* paths */
 #ifdef HAVE_PATHS_H
 #include <paths.h>


ossp-pkg/pth/pth_tcb.c 1.37 -> 1.38

--- pth_tcb.c    2002/01/27 11:03:41     1.37
+++ pth_tcb.c    2002/01/30 13:07:08     1.38
@@ -78,6 +78,11 @@
 
     /* mutex ring */
     pth_ring_t     mutexring;            /* ring of aquired mutex structures            */
+
+#ifdef PTH_EX
+    /* per-thread exception handling */
+    ex_ctx_t       ex_ctx;               /* exception handling context                  */
+#endif
 };
 
 #endif /* cpp */

CVSTrac 2.0.1