commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r6193 - gnuradio/trunk/gnuradio-core/src/lib/runtime


From: eb
Subject: [Commit-gnuradio] r6193 - gnuradio/trunk/gnuradio-core/src/lib/runtime
Date: Mon, 27 Aug 2007 23:59:31 -0600 (MDT)

Author: eb
Date: 2007-08-27 23:59:31 -0600 (Mon, 27 Aug 2007)
New Revision: 6193

Modified:
   gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_scheduler_thread.cc
   gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.cc
   gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.h
   gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc
   gnuradio/trunk/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc
   gnuradio/trunk/gnuradio-core/src/lib/runtime/qa_gr_top_block.h
Log:
Kludged around hang in hier_block2.  Merged -r6189:6191 from eb/fg
into trunk.


Modified: gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_scheduler_thread.cc
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_scheduler_thread.cc 
2007-08-28 05:14:38 UTC (rev 6192)
+++ gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_scheduler_thread.cc 
2007-08-28 05:59:31 UTC (rev 6193)
@@ -45,6 +45,9 @@
 
 void gr_scheduler_thread::start()
 {
+  if (GR_SCHEDULER_THREAD_DEBUG)
+    std::cout << "gr_scheduler_thread::start() "
+             << this << std::endl;
   start_undetached();
 }
 
@@ -70,6 +73,7 @@
 gr_scheduler_thread::stop()
 {
   if (GR_SCHEDULER_THREAD_DEBUG)
-    std::cout << "gr_scheduler_thread::stop()" << std::endl;
+    std::cout << "gr_scheduler_thread::stop() "
+             << this << std::endl;
   d_sts->stop();
 }

Modified: 
gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.cc
===================================================================
--- 
gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.cc    
    2007-08-28 05:14:38 UTC (rev 6192)
+++ 
gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.cc    
    2007-08-28 05:59:31 UTC (rev 6193)
@@ -82,10 +82,18 @@
 void
 gr_single_threaded_scheduler::run ()
 {
-  d_enabled = true;
+  // d_enabled = true;         // KLUDGE
   main_loop ();
 }
 
+void
+gr_single_threaded_scheduler::stop ()
+{ 
+  if (0)
+    std::cout << "gr_singled_threaded_scheduler::stop() "
+             << this << std::endl;
+  d_enabled = false;
+}
 
 inline static unsigned int
 round_up (unsigned int n, unsigned int multiple)

Modified: 
gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.h
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.h 
2007-08-28 05:14:38 UTC (rev 6192)
+++ gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.h 
2007-08-28 05:59:31 UTC (rev 6193)
@@ -40,7 +40,7 @@
   ~gr_single_threaded_scheduler ();
 
   void run ();
-  void stop () { d_enabled = false; }
+  void stop ();
 
  private:
   const std::vector<gr_block_sptr>     d_blocks;

Modified: gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc   
2007-08-28 05:14:38 UTC (rev 6192)
+++ gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc   
2007-08-28 05:59:31 UTC (rev 6193)
@@ -167,7 +167,7 @@
 gr_top_block_impl::unlock()
 {
   omni_mutex_lock lock(d_reconf);
-  if (d_lock_count == 0)
+  if (d_lock_count <= 0)
     throw std::runtime_error("unpaired unlock() call");
 
   d_lock_count--;

Modified: gnuradio/trunk/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc     
2007-08-28 05:14:38 UTC (rev 6192)
+++ gnuradio/trunk/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc     
2007-08-28 05:59:31 UTC (rev 6193)
@@ -29,9 +29,14 @@
 #include <gr_head.h>
 #include <gr_null_source.h>
 #include <gr_null_sink.h>
+#include <iostream>
 
+#define VERBOSE 0
+
 void qa_gr_top_block::t0()
 {
+  if (VERBOSE) std::cout << "qa_gr_top_block::t0()\n";
+
   gr_top_block_sptr tb = gr_make_top_block("top");
 
   CPPUNIT_ASSERT(tb);
@@ -39,10 +44,12 @@
 
 void qa_gr_top_block::t1_run()
 {
+  if (VERBOSE) std::cout << "qa_gr_top_block::t1()\n";
+
   gr_top_block_sptr tb = gr_make_top_block("top");
 
   gr_block_sptr src = gr_make_null_source(sizeof(int));
-  gr_block_sptr head = gr_make_head(sizeof(int), 1);
+  gr_block_sptr head = gr_make_head(sizeof(int), 100000);
   gr_block_sptr dst = gr_make_null_sink(sizeof(int));
 
   tb->connect(src, 0, head, 0);
@@ -52,10 +59,12 @@
 
 void qa_gr_top_block::t2_start_stop_wait()
 {
+  if (VERBOSE) std::cout << "qa_gr_top_block::t2()\n";
+
   gr_top_block_sptr tb = gr_make_top_block("top");
 
   gr_block_sptr src = gr_make_null_source(sizeof(int));
-  gr_block_sptr head = gr_make_head(sizeof(int), 1000000);
+  gr_block_sptr head = gr_make_head(sizeof(int), 100000);
   gr_block_sptr dst = gr_make_null_sink(sizeof(int));
 
   tb->connect(src, 0, head, 0);
@@ -68,14 +77,14 @@
 
 void qa_gr_top_block::t3_lock_unlock()
 {
+  if (VERBOSE) std::cout << "qa_gr_top_block::t3()\n";
+
   gr_top_block_sptr tb = gr_make_top_block("top");
 
   gr_block_sptr src = gr_make_null_source(sizeof(int));
-  gr_block_sptr head = gr_make_head(sizeof(int), 1000000);
   gr_block_sptr dst = gr_make_null_sink(sizeof(int));
 
-  tb->connect(src, 0, head, 0);
-  tb->connect(head, 0, dst, 0);
+  tb->connect(src, 0, dst, 0);
 
   tb->start();
 
@@ -88,10 +97,12 @@
 
 void qa_gr_top_block::t4_reconfigure()
 {
+  if (VERBOSE) std::cout << "qa_gr_top_block::t4()\n";
+
   gr_top_block_sptr tb = gr_make_top_block("top");
 
   gr_block_sptr src = gr_make_null_source(sizeof(int));
-  gr_block_sptr head = gr_make_head(sizeof(int), 1);
+  gr_block_sptr head = gr_make_head(sizeof(int), 100000);
   gr_block_sptr dst = gr_make_null_sink(sizeof(int));
 
   // Start infinite flowgraph

Modified: gnuradio/trunk/gnuradio-core/src/lib/runtime/qa_gr_top_block.h
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/runtime/qa_gr_top_block.h      
2007-08-28 05:14:38 UTC (rev 6192)
+++ gnuradio/trunk/gnuradio-core/src/lib/runtime/qa_gr_top_block.h      
2007-08-28 05:59:31 UTC (rev 6193)
@@ -35,7 +35,7 @@
   CPPUNIT_TEST(t1_run);
   CPPUNIT_TEST(t2_start_stop_wait);
   CPPUNIT_TEST(t3_lock_unlock);
-  // CPPUNIT_TEST(t4_reconfigure);  triggers 'join never returns' bug
+  CPPUNIT_TEST(t4_reconfigure);  // triggers 'join never returns' bug
 
   CPPUNIT_TEST_SUITE_END();
 





reply via email to

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