From 4022e568aa33f223df17b869af80f5c6565df286 Mon Sep 17 00:00:00 2001 From: michaelld Date: Sun, 13 Jan 2008 20:41:11 +0000 Subject: 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 --- usrp/host/lib/legacy/circular_linked_list.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'usrp/host/lib/legacy/circular_linked_list.h') 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 #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 (); -- cgit