gnuradio_core_PYDIRPATH=$pythondir
])
- dnl Don't do gnuradio-core if gruel or omnithread skipped
+ dnl Don't do gnuradio-core if gruel skipped
GRC_CHECK_DEPENDENCY(gnuradio-core, gruel)
- GRC_CHECK_DEPENDENCY(gnuradio-core, omnithread)
dnl If execution gets to here, $passed will be:
dnl with : if the --with code didn't error out
dnl Don't do gr-audio-portaudio if gnuradio-core skipped
GRC_CHECK_DEPENDENCY(gr-audio-portaudio, gnuradio-core)
+ GRC_CHECK_DEPENDENCY(gr-audio-portaudio, omnithread)
dnl If execution gets to here, $passed will be:
dnl with : if the --with code didn't error out
Package: libgnuradio-core
Section: libs
Architecture: any
-Depends: libgruel (= ${binary:Version}), libgnuradio-omnithread (= ${binary:Version}), ${shlibs:Depends}
+Depends: libgruel (= ${binary:Version}), ${shlibs:Depends}
Conflicts: libgnuradio-core0, libgnuradio-core0c2, libgnuradio-core0c2a
Replaces: libgnuradio-core0, libgnuradio-core0c2, libgnuradio-core0c2a
Suggests: gnuradio-doc
Architecture: any
Replaces: libgnuradio-core0-dev
Conflicts: libgnuradio-core0-dev
-Depends: libgnuradio-core (= ${binary:Version}), libgruel-dev (= ${binary:Version}), libgnuradio-omnithread-dev (= ${binary:Version}), libboost-thread1.37-dev, libboost-date-time1.37-dev, libcppunit-dev, libgsl0-dev, libatlas-base-dev, libfftw3-dev, swig
+Depends: libgnuradio-core (= ${binary:Version}), libgruel-dev (= ${binary:Version}), libboost-thread1.37-dev, libboost-date-time1.37-dev, libcppunit-dev, libgsl0-dev, libatlas-base-dev, libfftw3-dev, swig
Description: The GNU Software Radio Core Library
This package contains the core GNU Radio libraries.
.
/* -*- c++ -*- */
/*
- * Copyright 2004,2006,2007 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2007,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#include <fcntl.h>
#include <stdexcept>
#include <stdio.h>
+#include <gruel/thread.h>
// win32 (mingw/msvc) specific
#ifdef HAVE_IO_H
bool
gr_file_sink_base::open(const char *filename)
{
- omni_mutex_lock l(d_mutex); // hold mutex for duration of this function
+ gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this function
// we use the open system call to get access to the O_LARGEFILE flag.
int fd;
void
gr_file_sink_base::close()
{
- omni_mutex_lock l(d_mutex); // hold mutex for duration of this function
+ gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this function
if (d_new_fp){
fclose(d_new_fp);
gr_file_sink_base::do_update()
{
if (d_updated){
- omni_mutex_lock l(d_mutex); // hold mutex for duration of this block
+ gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this block
if (d_fp)
fclose(d_fp);
d_fp = d_new_fp; // install new file pointer
/* -*- c++ -*- */
/*
- * Copyright 2004,2007 Free Software Foundation, Inc.
+ * Copyright 2004,2007,2008 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#ifndef INCLUDED_GR_FILE_SINK_BASE_H
#define INCLUDED_GR_FILE_SINK_BASE_H
-#include <gnuradio/omnithread.h>
+#include <boost/thread.hpp>
#include <cstdio>
/*!
FILE *d_new_fp; // new FILE pointer
bool d_updated; // is there a new FILE pointer?
bool d_is_binary;
- omni_mutex d_mutex;
+ boost::mutex d_mutex;
protected:
gr_file_sink_base(const char *filename, bool is_binary);
/* -*- c++ -*- */
/*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
typedef char* optval_t;
#endif
+#include <gruel/thread.h>
+
#define SNK_VERBOSE 0
gr_udp_sink::gr_udp_sink (size_t itemsize,
bool
gr_udp_sink::open()
{
- omni_mutex_lock l(d_mutex); // hold mutex for duration of this function
+ gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this function
// create socket
if((d_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
void
gr_udp_sink::close()
{
- omni_mutex_lock l(d_mutex); // hold mutex for duration of this function
+ gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this function
if (d_socket){
shutdown(d_socket, SHUT_RDWR);
/* -*- c++ -*- */
/*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#define INCLUDED_GR_UDP_SINK_H
#include <gr_sync_block.h>
-#include <gnuradio/omnithread.h>
+#include <boost/thread.hpp>
#if defined(HAVE_SOCKET)
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#endif
+#include <gruel/thread.h>
+
class gr_udp_sink;
typedef boost::shared_ptr<gr_udp_sink> gr_udp_sink_sptr;
private:
size_t d_itemsize;
bool d_updated;
- omni_mutex d_mutex;
+ gruel::mutex d_mutex;
int d_payload_size; // maximum transmission unit (packet length)
int d_socket; // handle to socket
/* -*- c++ -*- */
/*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
bool
gr_udp_source::open()
{
- omni_mutex_lock l(d_mutex); // hold mutex for duration of this function
+ gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this function
// create socket
d_socket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
if(d_socket == -1) {
void
gr_udp_source::close()
{
- omni_mutex_lock l(d_mutex); // hold mutex for duration of this function
+ gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this function
if (d_socket){
shutdown(d_socket, SHUT_RDWR);
/* -*- c++ -*- */
/*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#define INCLUDED_GR_UDP_SOURCE_H
#include <gr_sync_block.h>
-#include <gnuradio/omnithread.h>
#if defined(HAVE_SOCKET)
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#endif
+#include <gruel/thread.h>
+
class gr_udp_source;
typedef boost::shared_ptr<gr_udp_source> gr_udp_source_sptr;
private:
size_t d_itemsize;
bool d_updated;
- omni_mutex d_mutex;
+ gruel::mutex d_mutex;
int d_payload_size; // maximum transmission unit (packet length)
int d_socket; // handle to socket
/* -*- c++ -*- */
/*
- * Copyright 2004,2006,2007,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2007,2008,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#include <cstring>
#include <cmath>
#include <fcntl.h>
+#include <gruel/thread.h>
// win32 (mingw/msvc) specific
#ifdef HAVE_IO_H
bool
gr_wavfile_sink::open(const char* filename)
{
- omni_mutex_lock l(d_mutex);
+ gruel::scoped_lock guard(d_mutex);
// we use the open system call to get access to the O_LARGEFILE flag.
int fd;
void
gr_wavfile_sink::close()
{
- omni_mutex_lock l(d_mutex);
+ gruel::scoped_lock guard(d_mutex);
if (!d_fp)
return;
void
gr_wavfile_sink::set_bits_per_sample(int bits_per_sample)
{
- omni_mutex_lock l(d_mutex);
+ gruel::scoped_lock guard(d_mutex);
if (bits_per_sample == 8 || bits_per_sample == 16) {
d_bytes_per_sample_new = bits_per_sample / 8;
}
void
gr_wavfile_sink::set_sample_rate(unsigned int sample_rate)
{
- omni_mutex_lock l(d_mutex);
+ gruel::scoped_lock guard(d_mutex);
d_sample_rate = sample_rate;
}
return;
}
- omni_mutex_lock l(d_mutex); // hold mutex for duration of this block
+ gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this block
if (d_fp) {
close_wav();
}
/* -*- c++ -*- */
/*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#include <gr_sync_block.h>
#include <gr_file_sink_base.h>
-#include <gnuradio/omnithread.h>
+#include <boost/thread.hpp>
class gr_wavfile_sink;
typedef boost::shared_ptr<gr_wavfile_sink> gr_wavfile_sink_sptr;
FILE *d_fp;
FILE *d_new_fp;
bool d_updated;
- omni_mutex d_mutex;
+ boost::mutex d_mutex;
/*!
* \brief Convert a sample value within [-1;+1] to a corresponding
/* -*- c++ -*- */
/*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#include <config.h>
#endif
+#if 0 // This needs reimplementation with boost threads and synchronization
+
#include <gri_logger.h>
#include <stdio.h>
#include <stdarg.h>
if (n > -1 && n < (ssize_t) sizeof(buf))
write(buf, n);
}
+
+#endif
/* -*- c++ -*- */
/*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#ifndef INCLUDED_GRI_LOGGER_H
#define INCLUDED_GRI_LOGGER_H
+#if 0 // This needs reimplementation with boost threads and synchronization
+
#include <stddef.h>
#include <gnuradio/omnithread.h>
#include <gr_buffer.h>
void printf(const char *format, ...);
};
+#endif
+
#endif /* INCLUDED_GRI_LOGGER_H */
int min_space = std::numeric_limits<int>::max();
for (int i = 0; i < d->noutputs (); i++){
- gr_buffer::scoped_lock guard(*d->output(i)->mutex());
+ gruel::scoped_lock guard(*d->output(i)->mutex());
#if 0
int n = round_down(d->output(i)->space_available(), output_multiple);
#else
/*
* Acquire the mutex and grab local copies of items_available and done.
*/
- gr_buffer::scoped_lock guard(*d->input(i)->mutex());
+ gruel::scoped_lock guard(*d->input(i)->mutex());
d_ninput_items[i] = d->input(i)->items_available();
d_input_done[i] = d->input(i)->done();
}
/*
* Acquire the mutex and grab local copies of items_available and done.
*/
- gr_buffer::scoped_lock guard(*d->input(i)->mutex());
+ gruel::scoped_lock guard(*d->input(i)->mutex());
d_ninput_items[i] = d->input(i)->items_available ();
d_input_done[i] = d->input(i)->done();
}
/* -*- c++ -*- */
/*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
void
gr_buffer::update_write_pointer (int nitems)
{
- scoped_lock guard(*mutex());
+ gruel::scoped_lock guard(*mutex());
d_write_index = index_add (d_write_index, nitems);
}
void
gr_buffer::set_done (bool done)
{
- scoped_lock guard(*mutex());
+ gruel::scoped_lock guard(*mutex());
d_done = done;
}
void
gr_buffer_reader::update_read_pointer (int nitems)
{
- scoped_lock guard(*mutex());
+ gruel::scoped_lock guard(*mutex());
d_read_index = d_buffer->index_add (d_read_index, nitems);
}
/* -*- c++ -*- */
/*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#include <gr_runtime_types.h>
#include <boost/weak_ptr.hpp>
-#include <boost/thread.hpp>
+#include <gruel/thread.h>
class gr_vmcircbuf;
class gr_buffer {
public:
- typedef boost::unique_lock<boost::mutex> scoped_lock;
-
virtual ~gr_buffer ();
/*!
size_t nreaders() const { return d_readers.size(); }
gr_buffer_reader* reader(size_t index) { return d_readers[index]; }
- boost::mutex *mutex() { return &d_mutex; }
+ gruel::mutex *mutex() { return &d_mutex; }
// -------------------------------------------------------------------------
//
// The mutex protects d_write_index, d_done and the d_read_index's in the buffer readers.
//
- boost::mutex d_mutex;
+ gruel::mutex d_mutex;
unsigned int d_write_index; // in items [0,d_bufsize)
bool d_done;
class gr_buffer_reader {
public:
- typedef gr_buffer::scoped_lock scoped_lock;
-
~gr_buffer_reader ();
/*!
void set_done (bool done) { d_buffer->set_done (done); }
bool done () const { return d_buffer->done (); }
- boost::mutex *mutex() { return d_buffer->mutex(); }
+ gruel::mutex *mutex() { return d_buffer->mutex(); }
/*!
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#include <gr_msg_queue.h>
#include <stdexcept>
-
gr_msg_queue_sptr
gr_make_msg_queue(unsigned int limit)
{
return gr_msg_queue_sptr (new gr_msg_queue(limit));
}
-
gr_msg_queue::gr_msg_queue(unsigned int limit)
- : d_not_empty(&d_mutex), d_not_full(&d_mutex),
+ : d_not_empty(), d_not_full(),
/*d_head(0), d_tail(0),*/ d_count(0), d_limit(limit)
{
}
if (msg->d_next)
throw std::invalid_argument("gr_msg_queue::insert_tail: msg already in queue");
- omni_mutex_lock l(d_mutex);
+ gruel::scoped_lock guard(d_mutex);
while (full_p())
- d_not_full.wait();
+ d_not_full.wait(guard);
if (d_tail == 0){
d_tail = d_head = msg;
msg->d_next.reset();
}
d_count++;
- d_not_empty.signal();
+ d_not_empty.notify_one();
}
gr_message_sptr
gr_msg_queue::delete_head()
{
- omni_mutex_lock l(d_mutex);
- gr_message_sptr m;
+ gruel::scoped_lock guard(d_mutex);
+ gr_message_sptr m;
while ((m = d_head) == 0)
- d_not_empty.wait();
+ d_not_empty.wait(guard);
d_head = m->d_next;
if (d_head == 0){
d_count--;
// m->d_next = 0;
m->d_next.reset();
- d_not_full.signal();
+ d_not_full.notify_one();
return m;
}
gr_message_sptr
gr_msg_queue::delete_head_nowait()
{
- omni_mutex_lock l(d_mutex);
- gr_message_sptr m;
+ gruel::scoped_lock guard(d_mutex);
+ gr_message_sptr m;
if ((m = d_head) == 0){
//return 0;
d_count--;
//m->d_next = 0;
m->d_next.reset();
- d_not_full.signal();
+ d_not_full.notify_one();
return m;
}
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#define INCLUDED_GR_MSG_QUEUE_H
#include <gr_msg_handler.h>
-#include <gnuradio/omnithread.h>
+#include <gruel/thread.h>
class gr_msg_queue;
typedef boost::shared_ptr<gr_msg_queue> gr_msg_queue_sptr;
* \ingroup misc
*/
class gr_msg_queue : public gr_msg_handler {
- omni_mutex d_mutex;
- omni_condition d_not_empty;
- omni_condition d_not_full;
- gr_message_sptr d_head;
- gr_message_sptr d_tail;
- unsigned int d_count; // # of messages in queue.
- unsigned int d_limit; // max # of messages in queue. 0 -> unbounded
+
+ gruel::mutex d_mutex;
+ gruel::condition_variable d_not_empty;
+ gruel::condition_variable d_not_full;
+ gr_message_sptr d_head;
+ gr_message_sptr d_tail;
+ unsigned int d_count; // # of messages in queue.
+ unsigned int d_limit; // max # of messages in queue. 0 -> unbounded
public:
gr_msg_queue(unsigned int limit);
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
*/
%ignore gr_msg_queue;
class gr_msg_queue : public gr_msg_handler {
- omni_mutex d_mutex;
- omni_condition d_cond;
- gr_message_sptr d_head;
- gr_message_sptr d_tail;
- int d_count;
-
public:
gr_msg_queue(unsigned int limit);
~gr_msg_queue();
/* -*- c++ -*- */
/*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#include <stdexcept>
-#if 0
- #include <boost/thread.hpp>
- typedef boost::mutex mutex;
- typedef boost::mutex::scoped_lock scoped_lock;
-#else
- #include <gnuradio/omnithread.h>
- typedef omni_mutex mutex;
- typedef omni_mutex_lock scoped_lock;
-#endif
+#include <gruel/thread.h>
namespace gnuradio {
- static mutex s_mutex;
+ static gruel::mutex s_mutex;
typedef std::map<gr_basic_block*, gr_basic_block_sptr> sptr_map;
static sptr_map s_map;
detail::sptr_magic::create_and_stash_initial_sptr(gr_hier_block2 *p)
{
gr_basic_block_sptr sptr(p);
- scoped_lock l();
+ gruel::scoped_lock guard();
s_map.insert(sptr_map::value_type(static_cast<gr_basic_block *>(p), sptr));
}
* p is a subclass of gr_hier_block2, thus we've already created the shared pointer
* and stashed it away. Fish it out and return it.
*/
- scoped_lock l();
+ gruel::scoped_lock guard();
sptr_map::iterator pos = s_map.find(static_cast<gr_basic_block *>(p));
if (pos == s_map.end())
throw std::invalid_argument("gr_sptr_magic: invalid pointer!");
return sptr;
}
};
-
/* -*- c++ -*- */
/*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#ifndef INCLUDED_GR_TPB_DETAIL_H
#define INCLUDED_GR_TPB_DETAIL_H
-#include <boost/thread.hpp>
+#include <gruel/thread.h>
class gr_block_detail;
* \brief used by thread-per-block scheduler
*/
struct gr_tpb_detail {
- typedef boost::unique_lock<boost::mutex> scoped_lock;
- boost::mutex mutex; //< protects all vars
+ gruel::mutex mutex; //< protects all vars
bool input_changed;
- boost::condition_variable input_cond;
+ gruel::condition_variable input_cond;
bool output_changed;
- boost::condition_variable output_cond;
+ gruel::condition_variable output_cond;
gr_tpb_detail()
: input_changed(false), output_changed(false) {}
//! Called by us
void clear_changed()
{
- scoped_lock guard(mutex);
+ gruel::scoped_lock guard(mutex);
input_changed = false;
output_changed = false;
}
//! Used by notify_downstream
void set_input_changed()
{
- scoped_lock guard(mutex);
+ gruel::scoped_lock guard(mutex);
input_changed = true;
input_cond.notify_one();
}
//! Used by notify_upstream
void set_output_changed()
{
- scoped_lock guard(mutex);
+ gruel::scoped_lock guard(mutex);
output_changed = true;
output_cond.notify_one();
}
/* -*- c++ -*- */
/*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
case gr_block_executor::BLKD_IN: // Wait for input.
{
- gr_tpb_detail::scoped_lock guard(d->d_tpb.mutex);
+ gruel::scoped_lock guard(d->d_tpb.mutex);
while(!d->d_tpb.input_changed)
d->d_tpb.input_cond.wait(guard);
}
case gr_block_executor::BLKD_OUT: // Wait for output buffer space.
{
- gr_tpb_detail::scoped_lock guard(d->d_tpb.mutex);
+ gruel::scoped_lock guard(d->d_tpb.mutex);
while(!d->d_tpb.output_changed)
d->d_tpb.output_cond.wait(guard);
}
#include <gnuradio/omnithread.h>
#include <string.h>
-#define LOGGING 0 // define to 0 or 1
+//#define LOGGING 0 // define to 0 or 1
#define SAMPLE_FORMAT paFloat32
typedef float sample_t;
int navail_samples = self->d_reader->items_available();
if (nreqd_samples <= navail_samples){ // We've got enough data...
- if (LOGGING)
- self->d_log->printf("PAsink cb: f/b = %4ld\n", framesPerBuffer);
+ //if (LOGGING)
+ // self->d_log->printf("PAsink cb: f/b = %4ld\n", framesPerBuffer);
// copy from ringbuffer into output buffer
memcpy(outputBuffer,
self->d_reader->read_pointer(),
}
else { // underrun
- if (LOGGING)
- self->d_log->printf("PAsink cb: f/b = %4ld UNDERRUN\n", framesPerBuffer);
+ //if (LOGGING)
+ // self->d_log->printf("PAsink cb: f/b = %4ld UNDERRUN\n", framesPerBuffer);
self->d_nunderuns++;
::write(2, "aU", 2); // FIXME change to non-blocking call
d_nunderuns(0)
{
memset(&d_output_parameters, 0, sizeof(d_output_parameters));
- if (LOGGING)
- d_log = gri_logger::singleton();
+ //if (LOGGING)
+ // d_log = gri_logger::singleton();
PaError err;
int i, numDevices;
#include <string>
#include <portaudio.h>
#include <stdexcept>
-#include <gri_logger.h>
+//#include <gri_logger.h>
class audio_portaudio_sink;
typedef boost::shared_ptr<audio_portaudio_sink> audio_portaudio_sink_sptr;
// random stats
int d_nunderuns; // count of underruns
- gri_logger_sptr d_log; // handle to non-blocking logging instance
+ //gri_logger_sptr d_log; // handle to non-blocking logging instance
void output_error_msg (const char *msg, int err);
void bail (const char *msg, int err) throw (std::runtime_error);
#include <gnuradio/omnithread.h>
#include <string.h>
-#define LOGGING 0 // define to 0 or 1
+//#define LOGGING 0 // define to 0 or 1
#define SAMPLE_FORMAT paFloat32
typedef float sample_t;
int nframes_room = self->d_writer->space_available() / nchan;
if (nframes_to_copy <= nframes_room){ // We've got room for the data ..
- if (LOGGING)
- self->d_log->printf("PAsrc cb: f/b = %4ld\n", framesPerBuffer);
+ //if (LOGGING)
+ // self->d_log->printf("PAsrc cb: f/b = %4ld\n", framesPerBuffer);
// copy from input buffer to ringbuffer
memcpy(self->d_writer->write_pointer(),
}
else { // overrun
- if (LOGGING)
- self->d_log->printf("PAsrc cb: f/b = %4ld OVERRUN\n", framesPerBuffer);
+ //if (LOGGING)
+ // self->d_log->printf("PAsrc cb: f/b = %4ld OVERRUN\n", framesPerBuffer);
self->d_noverruns++;
::write(2, "aO", 2); // FIXME change to non-blocking call
d_noverruns(0)
{
memset(&d_input_parameters, 0, sizeof(d_input_parameters));
- if (LOGGING)
- d_log = gri_logger::singleton();
+ //if (LOGGING)
+ // d_log = gri_logger::singleton();
PaError err;
int i, numDevices;
#include <string>
#include <portaudio.h>
#include <stdexcept>
-#include <gri_logger.h>
+//#include <gri_logger.h>
class audio_portaudio_source;
typedef boost::shared_ptr<audio_portaudio_source> audio_portaudio_source_sptr;
// random stats
int d_noverruns; // count of overruns
- gri_logger_sptr d_log; // handle to non-blocking logging instance
+ //gri_logger_sptr d_log; // handle to non-blocking logging instance
void output_error_msg (const char *msg, int err);
void bail (const char *msg, int err) throw (std::runtime_error);
realtime.h \
sys_pri.h \
thread_body_wrapper.h \
- thread_group.h
+ thread_group.h \
+ thread.h
--- /dev/null
+/* -*- c++ -*- */
+/*
+ * Copyright 2009 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.
+ */
+#ifndef INCLUDED_THREAD_H
+#define INCLUDED_THREAD_H
+
+#include <boost/thread.hpp>
+
+namespace gruel {
+
+ typedef boost::mutex mutex;
+ typedef boost::unique_lock<boost::mutex> scoped_lock;
+ typedef boost::condition_variable condition_variable;
+
+} /* namespace gruel */
+
+#endif /* INCLUDED_THREAD_H */
/* -*- c++ -*- */
/*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
#ifndef INCLUDED_THREAD_BODY_WRAPPER_H
#define INCLUDED_THREAD_BODY_WRAPPER_H
-#include <boost/thread.hpp>
+#include <gruel/thread.h>
#include <exception>
#include <iostream>
/*
* Copyright (C) 2001-2003 William E. Kempf
* Copyright (C) 2007 Anthony Williams
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef INCLUDED_GRUEL_THREAD_GROUP_H
#define INCLUDED_GRUEL_THREAD_GROUP_H
+#include <gruel/thread.h>
#include <boost/utility.hpp>
-#include <boost/thread.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <boost/function.hpp>