commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5903 - gnuradio/trunk/gr-pager/src


From: jcorgan
Subject: [Commit-gnuradio] r5903 - gnuradio/trunk/gr-pager/src
Date: Wed, 4 Jul 2007 11:10:23 -0600 (MDT)

Author: jcorgan
Date: 2007-07-04 11:10:23 -0600 (Wed, 04 Jul 2007)
New Revision: 5903

Modified:
   gnuradio/trunk/gr-pager/src/flex_demod.py
   gnuradio/trunk/gr-pager/src/usrp_flex.py
Log:
Fix long standing hang when exiting due to blocking read in gr-pager.

Modified: gnuradio/trunk/gr-pager/src/flex_demod.py
===================================================================
--- gnuradio/trunk/gr-pager/src/flex_demod.py   2007-07-04 16:56:30 UTC (rev 
5902)
+++ gnuradio/trunk/gr-pager/src/flex_demod.py   2007-07-04 17:10:23 UTC (rev 
5903)
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 

Modified: gnuradio/trunk/gr-pager/src/usrp_flex.py
===================================================================
--- gnuradio/trunk/gr-pager/src/usrp_flex.py    2007-07-04 16:56:30 UTC (rev 
5902)
+++ gnuradio/trunk/gr-pager/src/usrp_flex.py    2007-07-04 17:10:23 UTC (rev 
5903)
@@ -1,5 +1,26 @@
 #!/usr/bin/env python
 
+#
+# Copyright 2006,2007 Free Software Foundation, Inc.
+# 
+# This file is part of GNU Radio
+# 
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+# 
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+# 
+
 from gnuradio import gr, gru, usrp, optfir, eng_notation, blks, pager
 from gnuradio.eng_option import eng_option
 from optparse import OptionParser
@@ -127,9 +148,12 @@
     try:
         fg.start()
        while 1:
-           msg = queue.delete_head() # Blocking read
-           fields = split(msg.to_string(), chr(128))
-           print join(fields, '|')
+           if not queue.empty_p():
+               msg = queue.delete_head() # Blocking read
+               fields = split(msg.to_string(), chr(128))
+               print join(fields, '|')
+           else:
+               time.sleep(1)
 
     except KeyboardInterrupt:
         fg.stop()





reply via email to

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