summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
authorjcorgan2006-12-18 05:39:40 +0000
committerjcorgan2006-12-18 05:39:40 +0000
commit424a1b454020727163cbbb0b19e8ea2f0833ef85 (patch)
tree1490a6da0eba69e6f5eb0e738785565ffc21ef4f /gnuradio-core
parentbc0f3fc1f8593a25d2f9bc1c83d73260d18d33ac (diff)
downloadgnuradio-424a1b454020727163cbbb0b19e8ea2f0833ef85.tar.gz
gnuradio-424a1b454020727163cbbb0b19e8ea2f0833ef85.tar.bz2
gnuradio-424a1b454020727163cbbb0b19e8ea2f0833ef85.zip
Cleanup on hierarchical flowgraph code.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@4133 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_local_sighandler.h3
-rw-r--r--gnuradio-core/src/lib/runtime/gr_runtime.cc2
-rw-r--r--gnuradio-core/src/lib/runtime/gr_runtime_impl.cc15
3 files changed, 14 insertions, 6 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_local_sighandler.h b/gnuradio-core/src/lib/runtime/gr_local_sighandler.h
index 08e8edf00..011b0853a 100644
--- a/gnuradio-core/src/lib/runtime/gr_local_sighandler.h
+++ b/gnuradio-core/src/lib/runtime/gr_local_sighandler.h
@@ -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>
/*!
diff --git a/gnuradio-core/src/lib/runtime/gr_runtime.cc b/gnuradio-core/src/lib/runtime/gr_runtime.cc
index 93f78fea8..aab8ea5ab 100644
--- a/gnuradio-core/src/lib/runtime/gr_runtime.cc
+++ b/gnuradio-core/src/lib/runtime/gr_runtime.cc
@@ -49,7 +49,7 @@ gr_runtime::~gr_runtime()
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)
{
diff --git a/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc b/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
index dcd904a01..f8d65261e 100644
--- a/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
+++ b/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
@@ -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 @@ gr_scheduler_thread::run_undetached(void *arg)
// 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;