commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4133 - in gnuradio/trunk: . gnuradio-core/src/lib/run


From: jcorgan
Subject: [Commit-gnuradio] r4133 - in gnuradio/trunk: . gnuradio-core/src/lib/runtime
Date: Sun, 17 Dec 2006 22:39:40 -0700 (MST)

Author: jcorgan
Date: 2006-12-17 22:39:40 -0700 (Sun, 17 Dec 2006)
New Revision: 4133

Modified:
   gnuradio/trunk/configure.ac
   gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_local_sighandler.h
   gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_runtime.cc
   gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
Log:
Cleanup on hierarchical flowgraph code.

Modified: gnuradio/trunk/configure.ac
===================================================================
--- gnuradio/trunk/configure.ac 2006-12-18 05:27:03 UTC (rev 4132)
+++ gnuradio/trunk/configure.ac 2006-12-18 05:39:40 UTC (rev 4133)
@@ -74,7 +74,7 @@
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(fcntl.h limits.h strings.h time.h sys/ioctl.h sys/time.h 
unistd.h)
 AC_CHECK_HEADERS(linux/ppdev.h sys/mman.h sys/select.h sys/types.h)
-AC_CHECK_HEADERS(sys/resource.h stdint.h sched.h)
+AC_CHECK_HEADERS(sys/resource.h stdint.h sched.h signal.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -90,7 +90,7 @@
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS([mmap select socket strcspn strerror strspn getpagesize 
sysconf])
 AC_CHECK_FUNCS([snprintf gettimeofday nanosleep sched_setscheduler])
-AC_CHECK_FUNCS([modf sqrt])
+AC_CHECK_FUNCS([modf sqrt sigaction sigprocmask])
 
 AC_CHECK_LIB(m, sincos, [AC_DEFINE([HAVE_SINCOS],[1],[Define to 1 if your 
system has `sincos'.])])
 AC_CHECK_LIB(m, sincosf,[AC_DEFINE([HAVE_SINCOSF],[1],[Define to 1 if your 
system has `sincosf'.])])

Modified: gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_local_sighandler.h
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_local_sighandler.h  
2006-12-18 05:27:03 UTC (rev 4132)
+++ gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_local_sighandler.h  
2006-12-18 05:39:40 UTC (rev 4133)
@@ -23,7 +23,10 @@
 #ifndef INCLUDED_GR_LOCAL_SIGHANDLER_H
 #define INCLUDED_GR_LOCAL_SIGHANDLER_H
 
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
+#endif
+
 #include <string>
 
 /*!

Modified: gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_runtime.cc
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_runtime.cc  2006-12-18 
05:27:03 UTC (rev 4132)
+++ gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_runtime.cc  2006-12-18 
05:39:40 UTC (rev 4133)
@@ -49,7 +49,7 @@
     delete d_impl;
 }
 
-// HACK: This prevents using more than one gr_runtime instance
+// FIXME: This prevents using more than one gr_runtime instance
 static void 
 runtime_sigint_handler(int signum)
 {

Modified: gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc     
2006-12-18 05:27:03 UTC (rev 4132)
+++ gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc     
2006-12-18 05:39:40 UTC (rev 4133)
@@ -24,16 +24,20 @@
 #include "config.h"
 #endif
 
-#define GR_RUNTIME_IMPL_DEBUG 0
-
 #include <gr_runtime_impl.h>
 #include <gr_simple_flowgraph.h>
 #include <gr_hier_block2.h>
 #include <gr_hier_block2_detail.h>
+
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
+#endif
+
 #include <stdexcept>
 #include <iostream>
 
+#define GR_RUNTIME_IMPL_DEBUG 0
+
 gr_runtime_impl::gr_runtime_impl(gr_hier_block2_sptr top_block) 
   : d_running(false),
     d_top_block(top_block),
@@ -116,12 +120,13 @@
     // First code to run in new thread context
 
     // Mask off SIGINT in this thread to gaurantee mainline thread gets signal
+#ifdef HAVE_SIGPROCMASK
     sigset_t old_set;
     sigset_t new_set;
-    sigfillset(&new_set);
-    sigdelset(&new_set, SIGINT);
+    sigemptyset(&new_set);
+    sigaddset(&new_set, SIGINT);
     sigprocmask(SIG_BLOCK, &new_set, &old_set);
-
+#endif
     // Run the single-threaded scheduler
     d_sts->run();
     return 0;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]