summaryrefslogtreecommitdiff
path: root/gruel
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-24 00:34:28 -0800
committerJosh Blum <josh@joshknows.com>2011-02-27 19:58:32 -0800
commite73c25fb9226029f0e50052b1ffacedb3a78622b (patch)
treeb480f83b5b614f67b4c544f955fb85b3c338762e /gruel
parenta02bb131f68d5aa66093310c393562671e389778 (diff)
gruel thread simplification:
Removed get_new_timeout from thread.h (usrp2_vrt carryover) Basically it was created because of a misunderstanding of the time types; and its only ever called once. This also removes thread.cc Call posix_time::milliseconds in usrp2 control.cc. Notice that it passes a time_duration rather than a ptime (aka system time). Added #include <deque> to gr_buffer.h. It turns out that boost posix_time.hpp implicitly included the deque header which was missing from gr_buffer.h Replaced the include for thread.hpp with only the includes for the boost thread types mentioned in gruel/thread.h. Also, making use of the scoped_lock typedef that comes with boost thread locks. boost 3.5 safe.
Diffstat (limited to 'gruel')
-rw-r--r--gruel/src/include/gruel/thread.h16
-rw-r--r--gruel/src/lib/Makefile.am1
-rw-r--r--gruel/src/lib/thread.cc35
3 files changed, 6 insertions, 46 deletions
diff --git a/gruel/src/include/gruel/thread.h b/gruel/src/include/gruel/thread.h
index d72e5520ce..5a8ab18766 100644
--- a/gruel/src/include/gruel/thread.h
+++ b/gruel/src/include/gruel/thread.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2009,2010 Free Software Foundation, Inc.
+ * Copyright 2009,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -21,21 +21,17 @@
#ifndef INCLUDED_THREAD_H
#define INCLUDED_THREAD_H
-#include <boost/thread.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/locks.hpp>
+#include <boost/thread/condition_variable.hpp>
namespace gruel {
typedef boost::thread thread;
typedef boost::mutex mutex;
- typedef boost::unique_lock<boost::mutex> scoped_lock;
+ typedef boost::mutex::scoped_lock scoped_lock;
typedef boost::condition_variable condition_variable;
- typedef boost::posix_time::time_duration duration;
-
- /*!
- * Returns absolute time 'secs' into the future
- */
- boost::system_time get_new_timeout(double secs);
} /* namespace gruel */
diff --git a/gruel/src/lib/Makefile.am b/gruel/src/lib/Makefile.am
index b9b35ae10a..f37ab27a15 100644
--- a/gruel/src/lib/Makefile.am
+++ b/gruel/src/lib/Makefile.am
@@ -45,7 +45,6 @@ MSG_LIB = msg/libmsg.la
libgruel_la_SOURCES = \
realtime.cc \
sys_pri.cc \
- thread.cc \
thread_body_wrapper.cc \
thread_group.cc
diff --git a/gruel/src/lib/thread.cc b/gruel/src/lib/thread.cc
deleted file mode 100644
index d8f77b5067..0000000000
--- a/gruel/src/lib/thread.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <gruel/thread.h>
-
-namespace gruel {
-
- boost::system_time
- get_new_timeout(double secs)
- {
- return boost::get_system_time() + boost::posix_time::milliseconds(long(secs*1e3));
- }
-
-}