commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8850 - usrp2/branches/features/host-ng/host-ng/lib


From: jcorgan
Subject: [Commit-gnuradio] r8850 - usrp2/branches/features/host-ng/host-ng/lib
Date: Wed, 9 Jul 2008 18:42:04 -0600 (MDT)

Author: jcorgan
Date: 2008-07-09 18:42:03 -0600 (Wed, 09 Jul 2008)
New Revision: 8850

Modified:
   usrp2/branches/features/host-ng/host-ng/lib/usrp2_impl.cc
   usrp2/branches/features/host-ng/host-ng/lib/usrp2_impl.h
Log:
wip, consolidate mutexes, still deadlocking

Modified: usrp2/branches/features/host-ng/host-ng/lib/usrp2_impl.cc
===================================================================
--- usrp2/branches/features/host-ng/host-ng/lib/usrp2_impl.cc   2008-07-10 
00:20:33 UTC (rev 8849)
+++ usrp2/branches/features/host-ng/host-ng/lib/usrp2_impl.cc   2008-07-10 
00:42:03 UTC (rev 8850)
@@ -79,7 +79,7 @@
     : d_buffer(new eth_buffer()), d_pf(0), d_bg_thread(0), d_bg_running(false),
       d_rx_decim(0), d_rx_seqno(-1), d_tx_seqno(0), d_next_rid(0),
       d_num_rx_frames(0), d_num_rx_lost(0), d_num_rx_bytes(0), 
d_num_enqueued(0),
-      d_enqueued_mutex(), d_bg_pending_mutex(), 
d_bg_pending_cond(&d_bg_pending_mutex)
+      d_enqueued_mutex(), d_bg_pending_cond(&d_enqueued_mutex)
   {
     props_vector_t u2s = find(ifc, addr);
     if (u2s.size() != 1)
@@ -405,10 +405,11 @@
        break;  
 
       // Wait for user API thread(s) to process all enqueued packets.
-      // The channel ring runner that decrements d_num_enqueued to zero 
+      // The channel ring thread that decrements d_num_enqueued to zero 
       // will signal this thread to continue.
-      while(d_num_enqueued)
+      while(d_num_enqueued > 0)
        d_bg_pending_cond.wait();
+      d_enqueued_mutex.unlock();
     }
   }
   

Modified: usrp2/branches/features/host-ng/host-ng/lib/usrp2_impl.h
===================================================================
--- usrp2/branches/features/host-ng/host-ng/lib/usrp2_impl.h    2008-07-10 
00:20:33 UTC (rev 8849)
+++ usrp2/branches/features/host-ng/host-ng/lib/usrp2_impl.h    2008-07-10 
00:42:03 UTC (rev 8850)
@@ -55,7 +55,6 @@
 
     unsigned int   d_num_enqueued;
     omni_mutex     d_enqueued_mutex;
-    omni_mutex     d_bg_pending_mutex;
     omni_condition d_bg_pending_cond;
 
     pending_reply *d_pending_replies[NRIDS]; // indexed by 8-bit reply id





reply via email to

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