[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 28/50: controlport: more cleaning up.
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 28/50: controlport: more cleaning up. |
Date: |
Wed, 15 Apr 2015 21:07:55 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 075dc8166f7c7462fe5ac830cdccd90df5496a50
Author: Tom Rondeau <address@hidden>
Date: Tue Mar 3 17:00:48 2015 -0500
controlport: more cleaning up.
---
.../include/gnuradio/thrift_application_base.h | 18 +++++++++++++-----
.../include/gnuradio/thrift_server_template.h | 3 ++-
gr-blocks/python/blocks/qa_ctrlport_probes.py | 5 ++---
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
index d4a01db..4dc56a1 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
@@ -25,7 +25,7 @@
#include <gnuradio/api.h>
#include <gnuradio/logger.h>
-#include <boost/thread.hpp>
+#include <gnuradio/thread/thread.h>
namespace {
static const unsigned int THRIFTAPPLICATION_ACTIVATION_TIMEOUT_MS(600);
@@ -45,7 +45,7 @@ class GR_RUNTIME_API thrift_application_common
static bool d_main_called;
static bool d_have_thrift_config;
static std::string d_endpointStr;
- static boost::shared_ptr<boost::thread> d_thread;
+ static boost::shared_ptr<gr::thread::thread> d_thread;
apache::thrift::server::TServer* d_thriftserver;
@@ -67,7 +67,7 @@ public:
protected:
bool have_thrift_config() { return d_application->d_have_thrift_config; }
- void set_endpoint(const std::string& endpoint) {
d_application->d_endpointStr = endpoint;}
+ void set_endpoint(const std::string& endpoint);
//this one is the key... overwrite in templated/inherited variants
virtual TserverBase* i_impl() = 0;
@@ -82,6 +82,8 @@ protected:
gr::logger_ptr d_logger, d_debug_logger;
private:
+ gr::thread::mutex d_lock;
+
bool d_is_running;
void start_thrift();
@@ -118,8 +120,8 @@ void thrift_application_base<TserverBase,
TserverClass>::kickoff()
static bool run_once = false;
if(!run_once) {
- thrift_application_common::d_thread = boost::shared_ptr<boost::thread>
- (new boost::thread(boost::bind(&thrift_application_base::start_thrift,
d_this)));
+ thrift_application_common::d_thread = boost::shared_ptr<gr::thread::thread>
+ (new
gr::thread::thread(boost::bind(&thrift_application_base::start_thrift,
d_this)));
run_once = true;
}
@@ -136,6 +138,12 @@ const std::vector<std::string>
thrift_application_base<TserverBase, TserverClass
return ep;
}
+template<typename TserverBase, typename TserverClass>
+void thrift_application_base<TserverBase, TserverClass>::set_endpoint(const
std::string& endpoint)
+{
+ gr::thread::scoped_lock guard(d_lock);
+ d_application->d_endpointStr = endpoint;
+}
template<typename TserverBase, typename TserverClass>
TserverBase* thrift_application_base<TserverBase, TserverClass>::i()
diff --git a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
index 5a81886..ff025b0 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
@@ -131,12 +131,13 @@ thrift_server_template<TserverBase, TserverClass,
TImplClass, TThriftClass>::thr
if(nthreads <= 1) {
// "Thrift: Single-threaded server"
+ //std::cout << "Thrift Single-threaded server" << std::endl;
thrift_application_base<TserverBase, TImplClass>::d_thriftserver =
new thrift::server::TSimpleServer(processor, serverTransport,
transportFactory, protocolFactory);
}
else {
- // std::cout << "Thrift Multi-threaded server : " << nthreads << std::endl;
+ //std::cout << "Thrift Multi-threaded server : " << nthreads << std::endl;
boost::shared_ptr<thrift::concurrency::ThreadManager> threadManager
(thrift::concurrency::ThreadManager::newSimpleThreadManager(nthreads));
diff --git a/gr-blocks/python/blocks/qa_ctrlport_probes.py
b/gr-blocks/python/blocks/qa_ctrlport_probes.py
index cb428d6..6bdad7e 100644
--- a/gr-blocks/python/blocks/qa_ctrlport_probes.py
+++ b/gr-blocks/python/blocks/qa_ctrlport_probes.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -24,14 +24,13 @@ import sys, time, random, numpy
from gnuradio import gr, gr_unittest, blocks
import os, struct
-#from gnuradio import ctrlport
from gnuradio.ctrlport.GNURadioControlPortClient import
GNURadioControlPortClient
class test_ctrlport_probes(gr_unittest.TestCase):
def setUp(self):
- self.tb = gr.top_block()
os.environ['GR_CONF_CONTROLPORT_ON'] = 'True'
+ self.tb = gr.top_block()
def tearDown(self):
self.tb = None
- [Commit-gnuradio] [gnuradio] 07/50: controlport: Addes a FindThrift cmake module to find the Thrift headers, libraries, and Python files., (continued)
- [Commit-gnuradio] [gnuradio] 07/50: controlport: Addes a FindThrift cmake module to find the Thrift headers, libraries, and Python files., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 17/50: controlport: convert to To_PMT registration objects, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 20/50: runtime: more generic version of prefs class., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 22/50: cmake: force QA tests to turn ControlPort off by default., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 15/50: controlport: convert rpcpmtconverter::to_pmt() if statement to a function object map, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 01/50: Initial thrift definition for gnuradio, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 14/50: controlport: Thrift's binary type, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 09/50: controlport: cleanup and switching over to new Python common interface., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 23/50: controlport: cleaning up and using logger to display endpoint., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 34/50: controlport: replacement of nanosleep() with boost::sleep() in startup thread. Fix of merge error in booter_thrift., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 28/50: controlport: more cleaning up.,
git <=
- [Commit-gnuradio] [gnuradio] 31/50: controlport: moving the logger call that publishes Thrift's endpoint to i_impl()., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 24/50: controlport: adding performance and controlport monitor GRC blocks., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 29/50: controlport: changing the default port number on the Thrift interface to zero., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 21/50: controlport: Adds ability to configure Thrift through a config file, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 30/50: controlport: ephemeral / unused port number selection by OS working., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 13/50: controlport: using threaded server for multiple connections., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 39/50: controlport: documentation cleanup, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 35/50: controlport: cleanup, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 33/50: controlport: more cleanup and conveniences, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 11/50: controlport: more work on the translation layer; properties and setting parameters in gr-ctrlport-monitor now working., git, 2015/04/16