From 163cad2e96195745c76631eec3a32197f20c787c Mon Sep 17 00:00:00 2001 From: Dimitri Stolnikov Date: Thu, 27 Nov 2014 16:28:30 +0100 Subject: [PATCH] airspy: remove deprecated init/exit calls --- lib/airspy/airspy_source_c.cc | 39 ----------------------------------- lib/airspy/airspy_source_c.h | 3 --- 2 files changed, 42 deletions(-) diff --git a/lib/airspy/airspy_source_c.cc b/lib/airspy/airspy_source_c.cc index 49501d8..2bfef77 100644 --- a/lib/airspy/airspy_source_c.cc +++ b/lib/airspy/airspy_source_c.cc @@ -52,9 +52,6 @@ using namespace boost::assign; #define AIRSPY_FUNC_STR(func, arg) \ boost::str(boost::format(func "(%d)") % arg) + " has failed" -int airspy_source_c::_usage = 0; -boost::mutex airspy_source_c::_usage_mutex; - airspy_source_c_sptr make_airspy_source_c (const std::string & args) { return gnuradio::get_initial_sptr(new airspy_source_c (args)); @@ -95,15 +92,6 @@ airspy_source_c::airspy_source_c (const std::string &args) dict_t dict = params_to_dict(args); - { - boost::mutex::scoped_lock lock( _usage_mutex ); - - if ( _usage == 0 ) - airspy_init(); /* call only once before the first open */ - - _usage++; - } - _dev = NULL; ret = airspy_open( &_dev ); AIRSPY_THROW_ON_ERROR(ret, "Failed to open AirSpy device") @@ -159,15 +147,6 @@ airspy_source_c::~airspy_source_c () ret = airspy_close( _dev ); AIRSPY_THROW_ON_ERROR(ret, "Failed to close AirSpy") _dev = NULL; - - { - boost::mutex::scoped_lock lock( _usage_mutex ); - - _usage--; - - if ( _usage == 0 ) - airspy_exit(); /* call only once after last close */ - } } if (_fifo) @@ -299,15 +278,6 @@ std::vector airspy_source_c::get_devices() } #else - { - boost::mutex::scoped_lock lock( _usage_mutex ); - - if ( _usage == 0 ) - airspy_init(); /* call only once before the first open */ - - _usage++; - } - int ret; airspy_device *dev = NULL; ret = airspy_open(&dev); @@ -330,15 +300,6 @@ std::vector airspy_source_c::get_devices() ret = airspy_close(dev); } - { - boost::mutex::scoped_lock lock( _usage_mutex ); - - _usage--; - - if ( _usage == 0 ) - airspy_exit(); /* call only once after last close */ - } - #endif return devices; } diff --git a/lib/airspy/airspy_source_c.h b/lib/airspy/airspy_source_c.h index 9876c89..13f2eab 100644 --- a/lib/airspy/airspy_source_c.h +++ b/lib/airspy/airspy_source_c.h @@ -124,9 +124,6 @@ private: static int _airspy_rx_callback(airspy_transfer* transfer); int airspy_rx_callback(void *samples, int sample_count); - static int _usage; - static boost::mutex _usage_mutex; - airspy_device *_dev; boost::circular_buffer *_fifo;