commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 100/148: Made some gruel changes to get it


From: git
Subject: [Commit-gnuradio] [gnuradio] 100/148: Made some gruel changes to get it compiling on this system.
Date: Mon, 15 Aug 2016 00:47:29 +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 ac1d333dc6b9548c5e867e2ce44ef4415d2c2ac3
Author: Josh Blum <address@hidden>
Date:   Fri Dec 18 22:37:55 2009 -0800

    Made some gruel changes to get it compiling on this system.
---
 gruel/src/include/gruel/thread.h |  9 +++++++--
 gruel/src/lib/thread.cc          | 10 ++++++++--
 usrp2/host/lib/control.cc        |  2 +-
 usrp2/host/lib/find.cc           |  4 ++--
 usrp2/host/usrp2.pc.in           |  2 +-
 5 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/gruel/src/include/gruel/thread.h b/gruel/src/include/gruel/thread.h
index 53423e2..f73dd3d 100644
--- a/gruel/src/include/gruel/thread.h
+++ b/gruel/src/include/gruel/thread.h
@@ -22,7 +22,7 @@
 #define INCLUDED_THREAD_H
 
 #include <boost/thread.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/bind.hpp> //boost::bind used when creating threads
 
 namespace gruel {
 
@@ -33,7 +33,12 @@ namespace gruel {
   /*!
    * Returns absolute time 'secs' into the future
    */
-  boost::system_time get_new_timeout(double secs);
+  boost::system_time abs_time(double secs);
+
+  /*!
+   * Returns a delta time of 'secs' in duration
+   */
+  boost::posix_time::time_duration delta_time(double secs);
 
 } /* namespace gruel */
 
diff --git a/gruel/src/lib/thread.cc b/gruel/src/lib/thread.cc
index b470aae..7e18846 100644
--- a/gruel/src/lib/thread.cc
+++ b/gruel/src/lib/thread.cc
@@ -27,10 +27,16 @@
 
 namespace gruel {
 
+  boost::posix_time::time_duration
+  delta_time(double secs)
+  {
+    return boost::posix_time::milliseconds(long(secs*1e3));
+  }
+
   boost::system_time
-  get_new_timeout(double secs)
+  abs_time(double secs)
   {
-    return boost::get_system_time() + 
boost::posix_time::milliseconds(long(secs*1e3));
+    return boost::system_time() + 
boost::posix_time::milliseconds(long(secs*1e3));
   }
 
 } /* namespace gruel */
diff --git a/usrp2/host/lib/control.cc b/usrp2/host/lib/control.cc
index 761e515..96f90aa 100644
--- a/usrp2/host/lib/control.cc
+++ b/usrp2/host/lib/control.cc
@@ -45,7 +45,7 @@ namespace usrp2 {
   {
     boost::this_thread::disable_interruption di;
     gruel::scoped_lock l(d_mutex);
-    boost::system_time to(gruel::get_new_timeout(secs));
+    boost::system_time to(gruel::abs_time(secs));
 
     while (!d_complete) {
       if (!d_cond.timed_wait(l, to))
diff --git a/usrp2/host/lib/find.cc b/usrp2/host/lib/find.cc
index f41e2d6..a5c96b3 100644
--- a/usrp2/host/lib/find.cc
+++ b/usrp2/host/lib/find.cc
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008, 2009 Free Software Foundation, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -64,7 +64,7 @@ namespace usrp2{
             d_ctrl_transport->sendv(&iov, 1);
             //allow responses to gather
             boost::thread *ctrl_thread = new 
boost::thread(boost::bind(&find_helper::ctrl_thread_loop, this));
-            boost::this_thread::sleep(gruel::get_new_timeout(0.05)); //50ms
+            boost::this_thread::sleep(gruel::delta_time(0.05)); //50ms
             ctrl_thread->interrupt();
             ctrl_thread->join();
             return d_result;
diff --git a/usrp2/host/usrp2.pc.in b/usrp2/host/usrp2.pc.in
index eaef5f4..9cf3884 100644
--- a/usrp2/host/usrp2.pc.in
+++ b/usrp2/host/usrp2.pc.in
@@ -5,7 +5,7 @@ address@hidden@
 
 Name: usrp2
 Description: Universal Software Radio Peripheral 2
-Requires: gnuradio-omnithread gruel
+Requires: vrt gruel
 Version: @VERSION@
 Libs: -L${libdir} -lusrp2
 Cflags: -I${includedir} @DEFINES@



reply via email to

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