mirror of
				https://github.com/fairwaves/UHD-Fairwaves.git
				synced 2025-11-03 21:43:15 +00:00 
			
		
		
		
	Don't include uhd/utils/atomic.hpp - we disabled threading here long time ago
This commit is contained in:
		@@ -24,7 +24,6 @@
 | 
				
			|||||||
#include <uhd/stream.hpp>
 | 
					#include <uhd/stream.hpp>
 | 
				
			||||||
#include "umtrx_log_adapter.hpp"
 | 
					#include "umtrx_log_adapter.hpp"
 | 
				
			||||||
#include <uhd/utils/tasks.hpp>
 | 
					#include <uhd/utils/tasks.hpp>
 | 
				
			||||||
#include <uhd/utils/atomic.hpp>
 | 
					 | 
				
			||||||
#include <uhd/utils/byteswap.hpp>
 | 
					#include <uhd/utils/byteswap.hpp>
 | 
				
			||||||
#include <uhd/types/metadata.hpp>
 | 
					#include <uhd/types/metadata.hpp>
 | 
				
			||||||
#include <uhd/transport/vrt_if_packet.hpp>
 | 
					#include <uhd/transport/vrt_if_packet.hpp>
 | 
				
			||||||
@@ -92,22 +91,14 @@ public:
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ~recv_packet_handler(void){
 | 
					    ~recv_packet_handler(void){
 | 
				
			||||||
        _task_barrier.interrupt();
 | 
					 | 
				
			||||||
        _task_handlers.clear();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //! Resize the number of transport channels
 | 
					    //! Resize the number of transport channels
 | 
				
			||||||
    void resize(const size_t size){
 | 
					    void resize(const size_t size){
 | 
				
			||||||
        if (this->size() == size) return;
 | 
					        if (this->size() == size) return;
 | 
				
			||||||
        _task_handlers.clear();
 | 
					 | 
				
			||||||
        _props.resize(size);
 | 
					        _props.resize(size);
 | 
				
			||||||
        //re-initialize all buffers infos by re-creating the vector
 | 
					        //re-initialize all buffers infos by re-creating the vector
 | 
				
			||||||
        _buffers_infos = std::vector<buffers_info_type>(4, buffers_info_type(size));
 | 
					        _buffers_infos = std::vector<buffers_info_type>(4, buffers_info_type(size));
 | 
				
			||||||
        _task_barrier.resize(size);
 | 
					 | 
				
			||||||
        _task_handlers.resize(size);
 | 
					 | 
				
			||||||
        for (size_t i = 1/*skip 0*/; i < size; i++){
 | 
					 | 
				
			||||||
            //_task_handlers[i] = task::make(boost::bind(&recv_packet_handler::converter_thread_task, this, i));
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //! Get the channel width of this handler
 | 
					    //! Get the channel width of this handler
 | 
				
			||||||
@@ -666,8 +657,6 @@ private:
 | 
				
			|||||||
     ******************************************************************/
 | 
					     ******************************************************************/
 | 
				
			||||||
    UHD_INLINE void converter_thread_task(const size_t index)
 | 
					    UHD_INLINE void converter_thread_task(const size_t index)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        //_task_barrier.wait();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //shortcut references to local data structures
 | 
					        //shortcut references to local data structures
 | 
				
			||||||
        buffers_info_type &buff_info = get_curr_buffer_info();
 | 
					        buffers_info_type &buff_info = get_curr_buffer_info();
 | 
				
			||||||
        per_buffer_info_type &info = buff_info[index];
 | 
					        per_buffer_info_type &info = buff_info[index];
 | 
				
			||||||
@@ -691,13 +680,9 @@ private:
 | 
				
			|||||||
        if (buff_info.data_bytes_to_copy == _convert_bytes_to_copy){
 | 
					        if (buff_info.data_bytes_to_copy == _convert_bytes_to_copy){
 | 
				
			||||||
            info.buff.reset(); //effectively a release
 | 
					            info.buff.reset(); //effectively a release
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        //if (index == 0) _task_barrier.wait_others();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //! Shared variables for the worker threads
 | 
					    //! Shared variables for the worker threads
 | 
				
			||||||
    reusable_barrier _task_barrier;
 | 
					 | 
				
			||||||
    std::vector<task::sptr> _task_handlers;
 | 
					 | 
				
			||||||
    size_t _convert_nsamps;
 | 
					    size_t _convert_nsamps;
 | 
				
			||||||
    const rx_streamer::buffs_type *_convert_buffs;
 | 
					    const rx_streamer::buffs_type *_convert_buffs;
 | 
				
			||||||
    size_t _convert_buffer_offset_bytes;
 | 
					    size_t _convert_buffer_offset_bytes;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,7 +24,6 @@
 | 
				
			|||||||
#include <uhd/stream.hpp>
 | 
					#include <uhd/stream.hpp>
 | 
				
			||||||
#include "umtrx_log_adapter.hpp"
 | 
					#include "umtrx_log_adapter.hpp"
 | 
				
			||||||
#include <uhd/utils/tasks.hpp>
 | 
					#include <uhd/utils/tasks.hpp>
 | 
				
			||||||
#include <uhd/utils/atomic.hpp>
 | 
					 | 
				
			||||||
#include <uhd/utils/byteswap.hpp>
 | 
					#include <uhd/utils/byteswap.hpp>
 | 
				
			||||||
#include <uhd/types/metadata.hpp>
 | 
					#include <uhd/types/metadata.hpp>
 | 
				
			||||||
#include <uhd/transport/vrt_if_packet.hpp>
 | 
					#include <uhd/transport/vrt_if_packet.hpp>
 | 
				
			||||||
@@ -74,22 +73,14 @@ public:
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ~send_packet_handler(void){
 | 
					    ~send_packet_handler(void){
 | 
				
			||||||
        _task_barrier.interrupt();
 | 
					 | 
				
			||||||
        _task_handlers.clear();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //! Resize the number of transport channels
 | 
					    //! Resize the number of transport channels
 | 
				
			||||||
    void resize(const size_t size){
 | 
					    void resize(const size_t size){
 | 
				
			||||||
        if (this->size() == size) return;
 | 
					        if (this->size() == size) return;
 | 
				
			||||||
        _task_handlers.clear();
 | 
					 | 
				
			||||||
        _props.resize(size);
 | 
					        _props.resize(size);
 | 
				
			||||||
        static const boost::uint64_t zero = 0;
 | 
					        static const boost::uint64_t zero = 0;
 | 
				
			||||||
        _zero_buffs.resize(size, &zero);
 | 
					        _zero_buffs.resize(size, &zero);
 | 
				
			||||||
        _task_barrier.resize(size);
 | 
					 | 
				
			||||||
        _task_handlers.resize(size);
 | 
					 | 
				
			||||||
        for (size_t i = 1/*skip 0*/; i < size; i++){
 | 
					 | 
				
			||||||
            //_task_handlers[i] = task::make(boost::bind(&send_packet_handler::converter_thread_task, this, i));
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //! Get the channel width of this handler
 | 
					    //! Get the channel width of this handler
 | 
				
			||||||
@@ -390,8 +381,6 @@ private:
 | 
				
			|||||||
     ******************************************************************/
 | 
					     ******************************************************************/
 | 
				
			||||||
    UHD_INLINE void converter_thread_task(const size_t index)
 | 
					    UHD_INLINE void converter_thread_task(const size_t index)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        //_task_barrier.wait();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //shortcut references to local data structures
 | 
					        //shortcut references to local data structures
 | 
				
			||||||
        managed_send_buffer::sptr &buff = _props[index].buff;
 | 
					        managed_send_buffer::sptr &buff = _props[index].buff;
 | 
				
			||||||
        vrt::if_packet_info_t if_packet_info = *_convert_if_packet_info;
 | 
					        vrt::if_packet_info_t if_packet_info = *_convert_if_packet_info;
 | 
				
			||||||
@@ -419,13 +408,9 @@ private:
 | 
				
			|||||||
        const size_t num_vita_words32 = _header_offset_words32+if_packet_info.num_packet_words32;
 | 
					        const size_t num_vita_words32 = _header_offset_words32+if_packet_info.num_packet_words32;
 | 
				
			||||||
        buff->commit(num_vita_words32*sizeof(boost::uint32_t));
 | 
					        buff->commit(num_vita_words32*sizeof(boost::uint32_t));
 | 
				
			||||||
        buff.reset(); //effectively a release
 | 
					        buff.reset(); //effectively a release
 | 
				
			||||||
 | 
					 | 
				
			||||||
        //if (index == 0) _task_barrier.wait_others();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //! Shared variables for the worker threads
 | 
					    //! Shared variables for the worker threads
 | 
				
			||||||
    reusable_barrier _task_barrier;
 | 
					 | 
				
			||||||
    std::vector<task::sptr> _task_handlers;
 | 
					 | 
				
			||||||
    size_t _convert_nsamps;
 | 
					    size_t _convert_nsamps;
 | 
				
			||||||
    const tx_streamer::buffs_type *_convert_buffs;
 | 
					    const tx_streamer::buffs_type *_convert_buffs;
 | 
				
			||||||
    size_t _convert_buffer_offset_bytes;
 | 
					    size_t _convert_buffer_offset_bytes;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user