]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Remove the dependence of detached_ma27 on libbase.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 May 2009 19:59:42 +0000 (19:59 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 May 2009 19:59:42 +0000 (19:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@18870 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/Makefile
deal.II/contrib/hsl/Makefile
deal.II/contrib/hsl/source/detached_ma27.cc

index 4ccc8def6f40eeb4b2fc41c446b2393ed254fe13..b1c7fc8d1bcdc4658e56cb2342e6b73aa9288351 100644 (file)
@@ -106,8 +106,7 @@ optimized: contrib baseo laco 2do 1do 3do
 # make sure the function parser is also built (it isn't in the default
 # build list of the subdirectory, since it needs to be built before
 # libbase
-contrib: $(subst no,,$(subst yes,base,$(USE_CONTRIB_HSL))) \
-         contrib-functionparser
+contrib: contrib-functionparser
        cd $D/contrib && $(MAKE)
 
 contrib-functionparser:
index 30d7e349827807b54d4dd355764a55675d6eebbe..ed83b2b08e7f69d4da6b9f1e5abb27685f250ed2 100644 (file)
@@ -1,5 +1,5 @@
 # $Id$
-# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008 by Wolfgang Bangerth
+# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008, 2009 by Wolfgang Bangerth
 
 
 D = ../..
@@ -47,8 +47,7 @@ $(LIBDIR)/libhsl$(shared-lib-suffix): $(forward-declarations) $(o-files)
 # has actually nothing much to do, compile it in debug mode
 $(LIBDIR)/bin/detached_ma27$(EXEEXT):  \
                                $(LIBDIR)/contrib/hsl/detached_ma27.$(OBJEXT) \
-                                -lhsl \
-                               $(lib-base.o)
+                                -lhsl
        @echo =====hsl=========================$(MT)== Making   $(@F)
        @$(CXX) $(CXXFLAGS.g) $^ -o $@ $(F77LIBS) -lpthread $(LIBS)
 
index 33962d6d368771af3d243c6299c04b4d1272522c..388062a0cb23f90b262bf14d9132cfed684bd631 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2002, 2003, 2006, 2007, 2008 by the deal.II authors
+//    Copyright (C) 2002, 2003, 2006, 2007, 2008, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -12,7 +12,6 @@
 //----------------------------  detached_ma27.cc  ---------------------------
 
 #include <base/config.h>
-#include <base/thread_management.h>
 #include <hsl/hsl.h>
 
 #include <vector>
@@ -78,10 +77,19 @@ void die (const std::string &text, const T1 t1, const T2 t2, const pid_t pid)
  * parent. if the return value is non-null, then kill couldn't find out
  * about the parent process, so it is apparently gone
  */
+struct MonitorData
+{
+    const pid_t master_pid;
+    const pid_t primary_pid;
+};
+
+
 extern "C"
-void monitor_parent_liveness (const pid_t master_pid,
-                              const pid_t primary_pid) 
+void * monitor_parent_liveness (void *monitor_data) 
 {
+  const pid_t master_pid = ((MonitorData*)monitor_data)->master_pid;
+  const pid_t primary_pid = ((MonitorData*)monitor_data)->primary_pid;
+  
   while (true)
     {
       int ret = kill (master_pid, 0);
@@ -99,6 +107,8 @@ void monitor_parent_liveness (const pid_t master_pid,
                                        // ask again
       sleep (10);
     }
+
+  return 0;
 }
 
 
@@ -172,7 +182,9 @@ int main ()
                                    // be kill when we exit the main
                                    // program, but part from that we
                                    // create it detached
-  Threads::spawn (&monitor_parent_liveness)(master_pid, getpid());
+  static MonitorData monitor_data = { master_pid, getpid() };
+  pthread_t thread;
+  pthread_create (&thread, 0, &monitor_parent_liveness, &monitor_data);
   
                                    // then go into the action loop...
   unsigned int N, NZ, NSTEPS, LA, MAXFRT, LIW;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.