commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 34/50: controlport: replacement of nanoslee


From: git
Subject: [Commit-gnuradio] [gnuradio] 34/50: controlport: replacement of nanosleep() with boost::sleep() in startup thread. Fix of merge error in booter_thrift.
Date: Wed, 15 Apr 2015 21:07:56 +0000 (UTC)

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

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 4122e96257fd70c8469d0825f3a913ab3af6d16d
Author: Nate Goergen <address@hidden>
Date:   Sat Mar 7 14:33:18 2015 -0600

    controlport: replacement of nanosleep() with boost::sleep() in startup 
thread. Fix of merge error in booter_thrift.
---
 gnuradio-runtime/include/gnuradio/thrift_application_base.h | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/gnuradio-runtime/include/gnuradio/thrift_application_base.h 
b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
index 65cd83e..c7a57d5 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
@@ -26,6 +26,7 @@
 #include <gnuradio/api.h>
 #include <gnuradio/logger.h>
 #include <gnuradio/thread/thread.h>
+#include <boost/date_time/posix_time/posix_time.hpp>
 
 namespace {
   static const unsigned int THRIFTAPPLICATION_ACTIVATION_TIMEOUT_MS(600);
@@ -118,20 +119,13 @@ void thrift_application_base<TserverBase, 
TserverClass>::kickoff()
     thrift_application_common::d_thread = boost::shared_ptr<gr::thread::thread>
       (new 
gr::thread::thread(boost::bind(&thrift_application_base::start_thrift, 
d_this)));
 
-    ::timespec timer_ts, rem_ts;
-    timer_ts.tv_sec = 0; timer_ts.tv_nsec = 
THRIFTAPPLICATION_ACTIVATION_TIMEOUT_MS*1000;
-
     int iter = 0;
     while(!d_this->application_started()) {
-#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-      ::Sleep(timer_ts.tv_nsec / 1000000);
-#else
-      ::nanosleep(&timer_ts, &rem_ts);
-#endif
+      
boost::this_thread::sleep(boost::posix_time::milliseconds(THRIFTAPPLICATION_ACTIVATION_TIMEOUT_MS));
       if(!d_this->application_started())
         std::cerr << "@";
       if(iter++ > 100) {
-        std::cerr << "thrift_application_base::kickoff(), timeout waiting to 
port number might have failed?" << std::endl;
+        std::cerr << "thrift_application_base::c(), timeout waiting to port 
number might have failed?" << std::endl;
         break;
       }
     }



reply via email to

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