commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r6647 - gnuradio/branches/features/inband-usb/usrp/hos


From: eb
Subject: [Commit-gnuradio] r6647 - gnuradio/branches/features/inband-usb/usrp/host/lib/legacy
Date: Wed, 17 Oct 2007 11:56:19 -0600 (MDT)

Author: eb
Date: 2007-10-17 11:56:19 -0600 (Wed, 17 Oct 2007)
New Revision: 6647

Modified:
   gnuradio/branches/features/inband-usb/usrp/host/lib/legacy/fusb_linux.cc
Log:
Cleaned up and restructured fusb_ephandle_linux::stop to remove
busy wait.


Modified: 
gnuradio/branches/features/inband-usb/usrp/host/lib/legacy/fusb_linux.cc
===================================================================
--- gnuradio/branches/features/inband-usb/usrp/host/lib/legacy/fusb_linux.cc    
2007-10-17 15:17:13 UTC (rev 6646)
+++ gnuradio/branches/features/inband-usb/usrp/host/lib/legacy/fusb_linux.cc    
2007-10-17 17:56:19 UTC (rev 6647)
@@ -387,26 +387,31 @@
   if (!d_started)
     return true;
 
+  if (d_write_work_in_progress){
+    free_list_add (d_write_work_in_progress);
+    d_write_work_in_progress = 0;
+  }
+
+  if (d_read_work_in_progress){
+    free_list_add (d_read_work_in_progress);
+    d_read_work_in_progress = 0;
+    d_read_buffer = 0;
+    d_read_buffer_end = 0;
+  }
+
   d_devhandle->_cancel_pending_rqsts (this);
+  d_devhandle->_reap (false);
 
-  do {
-    d_devhandle->_reap (false);
+  while (1){
     usbdevfs_urb *urb;
     while ((urb = completed_list_get ()) != 0)
       free_list_add (urb);
 
-    if (d_write_work_in_progress){
-      free_list_add (d_write_work_in_progress);
-      d_write_work_in_progress = 0;
-    }
+    if (d_free_list.size () == (unsigned) d_nblocks)
+      break;
 
-    if (d_read_work_in_progress){
-      free_list_add (d_read_work_in_progress);
-      d_read_work_in_progress = 0;
-      d_read_buffer = 0;
-      d_read_buffer_end = 0;
-    }
-  } while (d_free_list.size () != (unsigned) d_nblocks);
+    d_devhandle->_reap(true);
+  }
 
   d_started = false;
   return true;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]