# 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:
# $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 = ../..
# 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)
// $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
//---------------------------- detached_ma27.cc ---------------------------
#include <base/config.h>
-#include <base/thread_management.h>
#include <hsl/hsl.h>
#include <vector>
* 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);
// ask again
sleep (10);
}
+
+ return 0;
}
// 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;