summaryrefslogtreecommitdiff
path: root/usrp/host/lib/legacy/circular_linked_list.h
diff options
context:
space:
mode:
authormichaelld2008-01-13 20:41:11 +0000
committermichaelld2008-01-13 20:41:11 +0000
commit4022e568aa33f223df17b869af80f5c6565df286 (patch)
tree901c6938f22f7dde651a7eefba8d45bbf0ebe85f /usrp/host/lib/legacy/circular_linked_list.h
parent88632145c80262215e8a1ea8c18fea4ae98772c9 (diff)
downloadgnuradio-4022e568aa33f223df17b869af80f5c6565df286.tar.gz
gnuradio-4022e568aa33f223df17b869af80f5c6565df286.tar.bz2
gnuradio-4022e568aa33f223df17b869af80f5c6565df286.zip
Merged OSX fixes for 10.5 (backwards compatible with 10.4 if not
earlier) for USRP legacy fast-usb code from r7358 branch into trunk: Fixed DEBUG commands in all files. Fixed flow control between originating and spawned threads. Fixed WritePipeAsync buffer write size. Added in debugging comments to fusb code, to better track async flow. NOT YET updated for MacOS X 10.5-specific IOKit code, but everything seems to work just fine as is. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7417 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp/host/lib/legacy/circular_linked_list.h')
-rw-r--r--usrp/host/lib/legacy/circular_linked_list.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/usrp/host/lib/legacy/circular_linked_list.h b/usrp/host/lib/legacy/circular_linked_list.h
index 14d81ac91..e495d609b 100644
--- a/usrp/host/lib/legacy/circular_linked_list.h
+++ b/usrp/host/lib/legacy/circular_linked_list.h
@@ -27,7 +27,10 @@
#include <stdexcept>
#define __INLINE__ inline
+
+#ifndef DO_DEBUG
#define DO_DEBUG 0
+#endif
#if DO_DEBUG
#define DEBUG(X) do{X} while(0);
@@ -168,17 +171,17 @@ public:
d_internal->lock ();
// find an available node
s_node_ptr l_node = d_available;
- DEBUG (fprintf (stderr, "w "));
+ DEBUG (fprintf (stderr, "w "););
while (! l_node) {
- DEBUG (fprintf (stderr, "x\n"));
+ DEBUG (fprintf (stderr, "x\n"););
// the ioBlock condition will automatically unlock() d_internal
d_ioBlock->wait ();
// and lock() is here
- DEBUG (fprintf (stderr, "y\n"));
+ DEBUG (fprintf (stderr, "y\n"););
l_node = d_available;
}
DEBUG (fprintf (stderr, "::f_n_a_n: #u = %ld, node = %p\n",
- num_used(), l_node));
+ num_used(), l_node););
// remove this one from the current available list
if (num_available () == 1) {
// last one, just set available to NULL
@@ -201,7 +204,7 @@ public:
if (!l_node) return;
d_internal->lock ();
DEBUG (fprintf (stderr, "::m_n_a: #u = %ld, node = %p\n",
- num_used(), l_node));
+ num_used(), l_node););
// remove this node from the inUse list
if (num_used () == 1) {
// last one, just set inUse to NULL
@@ -216,10 +219,10 @@ public:
l_node->insert_before (d_available);
d_n_used--;
- DEBUG (fprintf (stderr, "s%ld ", d_n_used));
+ DEBUG (fprintf (stderr, "s%ld ", d_n_used););
// signal the condition when new data arrives
d_ioBlock->signal ();
- DEBUG (fprintf (stderr, "t "));
+ DEBUG (fprintf (stderr, "t "););
// unlock the mutex for thread safety
d_internal->unlock ();