summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Goergen <nate.goergen.gitlab1@mile10.com>2015-03-15 20:29:09 -0500
committerTom Rondeau <tom@trondeau.com>2015-04-02 15:38:57 -0700
commiteae69f3420aea0318709b2bebe61380e8a18134f (patch)
tree3c9773af6fc450637a684652585277793885c10e
parentb0d7b7da51c0dcc3cd2d6752de7c30177db0070f (diff)
controlport: ensure proper ctrlport shutdown.
Create instance of rpcmanager to ensure proper ctrlport shutdown and some minor cleanup
-rw-r--r--gnuradio-runtime/include/gnuradio/thrift_application_base.h14
-rw-r--r--gnuradio-runtime/lib/controlport/rpcserver_selector.cc4
2 files changed, 8 insertions, 10 deletions
diff --git a/gnuradio-runtime/include/gnuradio/thrift_application_base.h b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
index f649ac297e..aa50c55dc8 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
@@ -39,7 +39,7 @@ namespace apache { namespace thrift { namespace server { class TServer; } } }
/*!
* \brief Class to be statically initialized by thrift_application_base. Used
- * to store state for thrift_application_base's static functions.
+ * to store state for thrift_application_base's singleton functions.
*/
class thrift_application_base_impl
@@ -69,7 +69,7 @@ public:
* \param TserverBase Template parameter naming the type of the server
* base, which is typically rpcserverbase.
* \param TserverClass Template parameter naming the eventual type of
- * the the fully derived application.
+ * the fully derived application.
* \param _app Reference to the fully derived application instance to
* be returned by thrift_application_base::i().
*/
@@ -208,20 +208,14 @@ void thrift_application_base<TserverBase, TserverClass>::start_application()
static_cast<unsigned int>(gr::prefs::singleton()->get_long("thrift", "init_attempts",
d_default_max_init_attempts));
-
if(!p_impl->d_application_initilized) {
- p_impl->d_start_thrift_thread.reset(
- (new gr::thread::thread(boost::bind(&thrift_application_base::start_thrift, d_application))));
+ p_impl->d_start_thrift_thread.reset(
+ (new gr::thread::thread(boost::bind(&thrift_application_base::start_thrift, d_application))));
bool app_started(false);
for(unsigned int attempts(0); (!app_started && attempts < max_init_attempts); ++attempts) {
boost::this_thread::sleep(boost::posix_time::milliseconds(THRIFTAPPLICATION_ACTIVATION_TIMEOUT_MS));
-
app_started = d_application->application_started();
-
- if(app_started) {
- std::cerr << "@";
- }
}
if(!app_started) {
diff --git a/gnuradio-runtime/lib/controlport/rpcserver_selector.cc b/gnuradio-runtime/lib/controlport/rpcserver_selector.cc
index 57b42ca4b6..bfb6eb9d7e 100644
--- a/gnuradio-runtime/lib/controlport/rpcserver_selector.cc
+++ b/gnuradio-runtime/lib/controlport/rpcserver_selector.cc
@@ -26,6 +26,10 @@
bool rpcmanager::make_aggregator(false);
+#ifdef GR_RPCSERVER_ENABLED
+rpcmanager manager_instance;;
+#endif
+
#ifdef GR_RPCSERVER_ICE
#error TODO ICE
#endif