]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Pass master_pid as an argument.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 1 Oct 2002 17:00:50 +0000 (17:00 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 1 Oct 2002 17:00:50 +0000 (17:00 +0000)
git-svn-id: https://svn.dealii.org/trunk@6578 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 0294d883a023c5f3222cde8687e114592069c2ea..a06486023c204a65c772d3d747e13dd1d0e3ee2a 100644 (file)
@@ -41,8 +41,6 @@
 #include <sys/errno.h>
 
 
-pid_t master_pid;
-
 
 namespace CommunicationsLog
 {
@@ -134,7 +132,7 @@ void die (const std::string &text, const T1 t1, const T2 t2)
  * about the parent process, so it is apparently gone
  */
 extern "C"
-void monitor_parent_liveness () 
+void monitor_parent_liveness (const pid_t master_pid
 {
 #ifdef HAVE_STD_STRINGSTREAM
   std::ostringstream s;
@@ -223,13 +221,14 @@ int main ()
                                    // of the master process, so that
                                    // we can check whether it is still
                                    // alive or not...
+  pid_t master_pid;
   get (&master_pid, 1, "master_pid");
                                    // ...and start off a thread that
                                    // actually checks that
   Threads::ThreadManager thread_manager;
   Threads::spawn (thread_manager,
                   Threads::encapsulate (&monitor_parent_liveness)
-                  .collect_args());
+                  .collect_args(master_pid));
   
                                    // 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.