diff options
author | Josh Blum | 2012-09-29 11:37:28 -0700 |
---|---|---|
committer | Josh Blum | 2012-09-29 11:37:28 -0700 |
commit | abfb98c1e4e468b994aecc0899dae9064d2477da (patch) | |
tree | 8eaaae7a7e8a57e4ccff9d53abfa8efa7b11beeb /lib/block_actor.cpp | |
parent | a4a860b2b710e61c103a36edebdd9b4d79732c38 (diff) | |
download | sandhi-abfb98c1e4e468b994aecc0899dae9064d2477da.tar.gz sandhi-abfb98c1e4e468b994aecc0899dae9064d2477da.tar.bz2 sandhi-abfb98c1e4e468b994aecc0899dae9064d2477da.zip |
gnuradio core mostly passing with apology fixes
Diffstat (limited to 'lib/block_actor.cpp')
-rw-r--r-- | lib/block_actor.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/block_actor.cpp b/lib/block_actor.cpp index af59009..61660f9 100644 --- a/lib/block_actor.cpp +++ b/lib/block_actor.cpp @@ -15,14 +15,25 @@ // along with io_sig program. If not, see <http://www.gnu.org/licenses/>. #include <gras_impl/block_actor.hpp> +#include <boost/thread/thread.hpp> #include <Theron/Framework.h> using namespace gnuradio; -static Theron::Framework global_framework(8); //TODO needs API config +static size_t hardware_concurrency(void) +{ + const size_t n = boost::thread::hardware_concurrency(); + return std::max(size_t(2), n); +} + +static Theron::Framework &get_global_framework(void) +{ + static Theron::Framework framework(hardware_concurrency()); + return framework; +} BlockActor::BlockActor(void): - Apology::Worker(global_framework) + Apology::Worker(get_global_framework()) { this->register_handlers(); } |