commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10149 - in gnuradio/branches/features/cppdb-test/gnur


From: jcorgan
Subject: [Commit-gnuradio] r10149 - in gnuradio/branches/features/cppdb-test/gnuradio-core/src: lib/runtime python/gnuradio/gr
Date: Sun, 21 Dec 2008 10:49:17 -0700 (MST)

Author: jcorgan
Date: 2008-12-21 10:49:17 -0700 (Sun, 21 Dec 2008)
New Revision: 10149

Modified:
   
gnuradio/branches/features/cppdb-test/gnuradio-core/src/lib/runtime/gr_top_block.i
   
gnuradio/branches/features/cppdb-test/gnuradio-core/src/python/gnuradio/gr/top_block.py
Log:
Revert partial fix for shutdown exception

Modified: 
gnuradio/branches/features/cppdb-test/gnuradio-core/src/lib/runtime/gr_top_block.i
===================================================================
--- 
gnuradio/branches/features/cppdb-test/gnuradio-core/src/lib/runtime/gr_top_block.i
  2008-12-21 17:02:34 UTC (rev 10148)
+++ 
gnuradio/branches/features/cppdb-test/gnuradio-core/src/lib/runtime/gr_top_block.i
  2008-12-21 17:49:17 UTC (rev 10149)
@@ -63,11 +63,4 @@
     r->wait();
     Py_END_ALLOW_THREADS;              // acquire global interpreter lock
 }
-
-// Shortcut to allow Python to directory call low-level stop(),
-// used in gr_top_block.py
-void top_block_stop(gr_top_block_sptr r)
-{
-    r->stop();
-}
 %}

Modified: 
gnuradio/branches/features/cppdb-test/gnuradio-core/src/python/gnuradio/gr/top_block.py
===================================================================
--- 
gnuradio/branches/features/cppdb-test/gnuradio-core/src/python/gnuradio/gr/top_block.py
     2008-12-21 17:02:34 UTC (rev 10148)
+++ 
gnuradio/branches/features/cppdb-test/gnuradio-core/src/python/gnuradio/gr/top_block.py
     2008-12-21 17:49:17 UTC (rev 10149)
@@ -1,5 +1,5 @@
 #
-# Copyright 2007,2008 Free Software Foundation, Inc.
+# Copyright 2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -20,11 +20,12 @@
 # 
 
 from gnuradio_swig_python import top_block_swig, \
-    top_block_wait_unlocked, top_block_run_unlocked, top_block_stop
+    top_block_wait_unlocked, top_block_run_unlocked
 
 #import gnuradio.gr.gr_threading as _threading
 import gr_threading as _threading
 
+
 #
 # There is no problem that can't be solved with an additional
 # level of indirection...
@@ -36,27 +37,18 @@
         _threading.Thread.__init__(self)
         self.setDaemon(1)
         self.tb = tb
-        self.interrupted = False
         self.event = _threading.Event()
         self.start()
 
     def run(self):
         top_block_wait_unlocked(self.tb)
-        # Don't set event if interrupted as internal Python state is
-        # no longer reliable in this thread context
-        if not self.interrupted:
-            self.event.set()
+        self.event.set()
 
     def wait(self):
-        try:
-            while not self.event.isSet():
-                self.event.wait(0.100)
-        except KeyboardInterrupt:
-            # top_block_wait_unlocked above is still blocked waiting for
-            # flowgraph threads to finish, so we must force flowgraph to stop
-            self.interrupted = True
-            top_block_stop(self.tb) # gr_top_block.i
+        while not self.event.isSet():
+            self.event.wait(0.100)
 
+
 #
 # This hack forces a 'has-a' relationship to look like an 'is-a' one.
 #





reply via email to

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