-dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc.
+dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2009 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Radio
dnl
dnl
dnl This file is part of GNU Radio
dnl
GRC_ENABLE(pmt)
GRC_WITH(pmt)
GRC_ENABLE(pmt)
GRC_WITH(pmt)
- dnl Don't do pmt if omnithread skipped
- GRC_CHECK_DEPENDENCY(pmt, omnithread)
-
dnl If execution gets to here, $passed will be:
dnl with : if the --with code didn't error out
dnl yes : if the --enable code passed muster and all dependencies are met
dnl If execution gets to here, $passed will be:
dnl with : if the --with code didn't error out
dnl yes : if the --enable code passed muster and all dependencies are met
Name: pmt
Description: The GNU Radio Polymorphic Type library
Name: pmt
Description: The GNU Radio Polymorphic Type library
-Requires: gnuradio-omnithread
Version: @VERSION@
Libs: -L${libdir} -lpmt
Version: @VERSION@
Libs: -L${libdir} -lpmt
-Cflags: -I${includedir}
\ No newline at end of file
-# Copyright 2006,2008 Free Software Foundation, Inc.
+# Copyright 2006,2008,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
#
# This file is part of GNU Radio
#
include $(top_srcdir)/Makefile.common
include $(top_srcdir)/Makefile.common
-AM_CPPFLAGS = $(DEFINES) $(OMNITHREAD_INCLUDES) $(BOOST_CPPFLAGS) \
+AM_CPPFLAGS = $(DEFINES) $(BOOST_CPPFLAGS) \
$(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
TESTS = test_pmt
$(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
TESTS = test_pmt
-libpmt_la_LDFLAGS = $(NO_UNDEFINED)
+libpmt_la_LDFLAGS = $(NO_UNDEFINED) $(BOOST_LDFLAGS)
# link the library against the c++ standard library
libpmt_la_LIBADD = \
# link the library against the c++ standard library
libpmt_la_LIBADD = \
-lstdc++
include_HEADERS = \
-lstdc++
include_HEADERS = \
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
*
* This file is part of GNU Radio
*
pmt_pool::pmt_pool(size_t itemsize, size_t alignment,
size_t allocation_size, size_t max_items)
pmt_pool::pmt_pool(size_t itemsize, size_t alignment,
size_t allocation_size, size_t max_items)
- : d_cond(&d_mutex),
- d_itemsize(ROUNDUP(itemsize, alignment)),
+ : d_itemsize(ROUNDUP(itemsize, alignment)),
d_alignment(alignment),
d_allocation_size(std::max(allocation_size, 16 * itemsize)),
d_max_items(max_items), d_n_items(0),
d_alignment(alignment),
d_allocation_size(std::max(allocation_size, 16 * itemsize)),
d_max_items(max_items), d_n_items(0),
void *
pmt_pool::malloc()
{
void *
pmt_pool::malloc()
{
- omni_mutex_lock l(d_mutex);
+ scoped_lock guard(d_mutex);
item *p;
if (d_max_items != 0){
while (d_n_items >= d_max_items)
item *p;
if (d_max_items != 0){
while (d_n_items >= d_max_items)
}
if (d_freelist){ // got something?
}
if (d_freelist){ // got something?
- omni_mutex_lock l(d_mutex);
+ scoped_lock guard(d_mutex);
item *p = (item *) foo;
p->d_next = d_freelist;
d_freelist = p;
d_n_items--;
if (d_max_items != 0)
item *p = (item *) foo;
p->d_next = d_freelist;
d_freelist = p;
d_n_items--;
if (d_max_items != 0)
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2009 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
*
* This file is part of GNU Radio
*
#define INCLUDED_PMT_POOL_H
#include <cstddef>
#define INCLUDED_PMT_POOL_H
#include <cstddef>
-#include <gnuradio/omnithread.h>
+#include <boost/thread.hpp>
/*!
* \brief very simple thread-safe fixed-size allocation pool
/*!
* \brief very simple thread-safe fixed-size allocation pool
- omni_mutex d_mutex;
- omni_condition d_cond;
+ typedef boost::unique_lock<boost::mutex> scoped_lock;
+ mutable boost::mutex d_mutex;
+ boost::condition_variable d_cond;
size_t d_itemsize;
size_t d_alignment;
size_t d_itemsize;
size_t d_alignment;