Boost logo

Boost-Commit :

From: kbelco_at_[hidden]
Date: 2007-09-25 19:11:14


Author: noel_belcourt
Date: 2007-09-25 19:11:12 EDT (Tue, 25 Sep 2007)
New Revision: 39534
URL: http://svn.boost.org/trac/boost/changeset/39534

Log:
Add macros to gcc.hpp to support pathscale toolset.

Added an optimization to the -lx unix timeout code. I
compute the amount of time the select call should sleep
until the "oldest" process times out. This ensures that
all processes that timeout will be killed within one
second of their expiration.

Text files modified:
   trunk/boost/config/compiler/gcc.hpp | 4 ++++
   trunk/tools/jam/src/execunix.c | 12 ++++++++----
   2 files changed, 12 insertions(+), 4 deletions(-)

Modified: trunk/boost/config/compiler/gcc.hpp
==============================================================================
--- trunk/boost/config/compiler/gcc.hpp (original)
+++ trunk/boost/config/compiler/gcc.hpp 2007-09-25 19:11:12 EDT (Tue, 25 Sep 2007)
@@ -43,6 +43,10 @@
 # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
 # define BOOST_NO_IS_ABSTRACT
 #elif __GNUC__ == 3
+# if defined (__PATHSCALE__)
+# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+# define BOOST_NO_IS_ABSTRACT
+# endif
    //
    // gcc-3.x problems:
    //

Modified: trunk/tools/jam/src/execunix.c
==============================================================================
--- trunk/tools/jam/src/execunix.c (original)
+++ trunk/tools/jam/src/execunix.c 2007-09-25 19:11:12 EDT (Tue, 25 Sep 2007)
@@ -62,6 +62,7 @@
 
 static clock_t tps = 0;
 static struct timeval tv;
+static int timeout = 0;
 static int intr = 0;
 static int cmdsrunning = 0;
 
@@ -355,6 +356,9 @@
 void populate_file_descriptors(int *fmax, fd_set *fds)
 {
     int i, fd_max = 0;
+ struct tms buf;
+ clock_t current = times(&buf);
+ timeout = globs.timeout;
 
     /* compute max read file descriptor for use in select */
     FD_ZERO(fds);
@@ -375,9 +379,9 @@
         }
 
         if (globs.timeout && cmdtab[i].pid) {
- struct tms buf;
- clock_t current = times(&buf);
- if (globs.timeout <= (current-cmdtab[i].start_time)/tps) {
+ clock_t consumed = (current - cmdtab[i].start_time) / tps;
+ timeout = (globs.timeout - consumed) < timeout ? (globs.timeout - consumed) : timeout;
+ if (globs.timeout <= consumed) {
                 killpg(cmdtab[i].pid, SIGKILL);
                 cmdtab[i].exit_reason = EXIT_TIMEOUT;
             }
@@ -414,7 +418,7 @@
 
         if (0 < globs.timeout) {
             /* force select to timeout so we can terminate expired processes */
- tv.tv_sec = globs.timeout;
+ tv.tv_sec = timeout;
             tv.tv_usec = 0;
 
             /* select will wait until: io on a descriptor, a signal, or we time out */


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk