commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 11/148: some house keeping while trying to


From: git
Subject: [Commit-gnuradio] [gnuradio] 11/148: some house keeping while trying to fix thread exception
Date: Mon, 15 Aug 2016 00:47:20 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

nwest pushed a commit to annotated tag old_usrp_devel_udp
in repository gnuradio.

commit ea4cf4d8c827b4c55944fe85cf33abd09ba9fbc5
Author: Josh Blum <address@hidden>
Date:   Mon Nov 2 15:33:46 2009 -0800

    some house keeping while trying to fix thread exception
---
 usrp2/host/lib/Makefile.am   | 4 ++++
 usrp2/host/lib/usrp2_impl.cc | 9 ++++-----
 usrp2/host/lib/usrp2_impl.h  | 2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/usrp2/host/lib/Makefile.am b/usrp2/host/lib/Makefile.am
index 0c3e180..5e427a4 100644
--- a/usrp2/host/lib/Makefile.am
+++ b/usrp2/host/lib/Makefile.am
@@ -27,6 +27,10 @@ AM_CPPFLAGS = \
 bin_PROGRAMS = usrp2_socket_opener
 usrp2_socket_opener_SOURCES = usrp2_socket_opener.cc
 
+install-data-hook:
+       chown root:usrp $(bindir)/usrp2_socket_opener
+       chmod 04750 $(bindir)/usrp2_socket_opener
+
 lib_LTLIBRARIES = \
        libusrp2.la
 
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index 9859440..26dba0a 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -380,11 +380,11 @@ namespace usrp2 {
   usrp2::impl::run_ctrl_thread()
   {
     d_ctrl_running = true;
-    uint32_t buff[100]; // FIXME use MTU
+    uint32_t buff[1500]; // FIXME use MTU
     while (d_ctrl_running){
       int ctrl_recv_len = d_eth_ctrl->read_packet_dont_block(buff, 
sizeof(buff));
       if (ctrl_recv_len > 0) handle_control_packet(buff, ctrl_recv_len);
-      boost::thread::sleep(gruel::get_new_timeout(0.05)); //50ms timeout
+      else boost::this_thread::sleep(gruel::get_new_timeout(0.05)); //50ms 
timeout
     }
   }
 
@@ -444,7 +444,7 @@ namespace usrp2 {
       return handle_data_packet(base, len);
   }
 
-  data_handler::result
+  void
   usrp2::impl::handle_control_packet(const void *base, size_t len)
   {
     // point to beginning of payload (subpackets)
@@ -471,12 +471,11 @@ namespace usrp2 {
       memcpy(rp->buffer(), p, std::min(oplen, buflen));
       rp->notify_completion();
       d_pending_replies[rid] = 0;
-      return data_handler::RELEASE;
+      return;
     }
 
     // TODO: handle unsolicited, USRP2 initiated, or late replies
     DEBUG_LOG("l");
-    return data_handler::RELEASE;
   }
   
   data_handler::result
diff --git a/usrp2/host/lib/usrp2_impl.h b/usrp2/host/lib/usrp2_impl.h
index e28ab89..594a4bf 100644
--- a/usrp2/host/lib/usrp2_impl.h
+++ b/usrp2/host/lib/usrp2_impl.h
@@ -112,7 +112,7 @@ namespace usrp2 {
     bool transmit_cmd_and_wait(void *cmd, size_t len, pending_reply *p, double 
secs=0.0);
     bool transmit_cmd(void *cmd, size_t len);
     virtual data_handler::result operator()(const void *base, size_t len);
-    data_handler::result handle_control_packet(const void *base, size_t len);
+    void handle_control_packet(const void *base, size_t len);
     data_handler::result handle_data_packet(const void *base, size_t len);
     bool dboard_info();
     bool reset_db();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]