[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 27/43: grc: optional thread-safe setters in
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 27/43: grc: optional thread-safe setters in generated code (#748) |
Date: |
Thu, 2 Apr 2015 19:15:51 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 95c59385950ca3012ba1b608250454271fb80707
Author: Sebastian Koslowski <address@hidden>
Date: Wed Jan 7 23:07:04 2015 +0100
grc: optional thread-safe setters in generated code (#748)
---
grc/blocks/options.xml | 16 ++++++++++++++++
grc/python/flow_graph.tmpl | 19 +++++++++++++++++--
2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml
index c1c94e4..6588dc7 100644
--- a/grc/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -158,6 +158,22 @@ part#slurp
<key>1</key>
</option>
</param>
+ <param>
+ <name>Thread-safe setters</name>
+ <key>thread_safe_setters</key>
+ <value></value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option>
+ <name>Off</name>
+ <key></key>
+ </option>
+ <option>
+ <name>On</name>
+ <key>1</key>
+ </option>
+ <tab>Advanced</tab>
+ </param>
<check>len($window_size) == 2</check>
<check>300 <= $(window_size)[0] <= 4096</check>
<check>300 <= $(window_size)[1] <= 4096</check>
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index 45d5d60..814b513 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -31,6 +31,9 @@ $DIVIDER
#end if
# Generated: $time.ctime()
$DIVIDER
+#if $flow_graph.get_option('thread_safe_setters')
+import threading
+#end if
## Call XInitThreads as the _very_ first thing.
## After some Qt import, it's too late
@@ -141,6 +144,10 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(',
'.join($size_strs))])
self.message_port_register_hier_in("$pad['label']")
#end for
#end if
+#if $flow_graph.get_option('thread_safe_setters')
+
+ self._lock = threading.RLock()
+#end if
########################################################
##Create Parameters
## Set the parameter to a property of self.
@@ -264,10 +271,18 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)),
[$(', '.join($size_strs))])
return self.$id
def set_$(id)(self, $id):
+ #if $flow_graph.get_option('thread_safe_setters')
+ with self._lock:
+ self.$id = $id
+ #for $callback in $var_id2cbs[$id]
+ $indent($callback)
+ #end for
+ #else
self.$id = $id
- #for $callback in $var_id2cbs[$id]
+ #for $callback in $var_id2cbs[$id]
$indent($callback)
- #end for
+ #end for
+ #end if
#end for
########################################################
- [Commit-gnuradio] [gnuradio] branch master updated (7fe6115 -> 3061e47), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 16/43: fec: LDPC async decoder now running, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 04/43: gnuradio-runtime: added the individual port assignments to the hier_block2 max/min_output_buffer size; if output ports have different size assignments only the block directly connected to the output port is changed otherwise every block within the hier is set to that output buffer size; therefore single output hier blocks will always set every block within to the output buffer size, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 17/43: gnuradio-runtume: hier_block2 output buffer lengths - clean up of debug output, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 26/43: grc: no shebang for hier blocks; use python2, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 15/43: fec: ldpc encoder now working in async encoder interface, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 06/43: gnuradio-runtime: (option 1) The hier block can now take a generic min/max output buffer length and assign it to every block within the hier (assumes all output buffers have the same min/max values set); (option 2) sets only the blocks connected to hier output ports and does not set the other internal blocks (requires that each port has different values); for single port output hier blocks only option 1 is possible., git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 07/43: gnuradio-runtime: non-helpful debug outputs removed from hier_block2 and hier_block2_detail, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 27/43: grc: optional thread-safe setters in generated code (#748),
git <=
- [Commit-gnuradio] [gnuradio] 19/43: gnuradio-runtime: added logger to flat_flowgraph and print out a warning for when the max_output_buffer isn't set to the requested value, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 28/43: grc: don't try to open missing files, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 01/43: gnuradio-runtime: trying to see if this will handle the output buffer size of hier blocks; trying to find the proper casting methods, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 10/43: fec: cleaning up LDPC warnings, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 18/43: fec: ldpc works, add iterations meta tag, etc, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 34/43: Merge remote-tracking branch 'saikwolf/logging_flat_flowgraph', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 03/43: gnuradio-runtime:: removed the individual port setting on hier_block2, current operation assuming the buffers are being set for latency and therefore all blocks are being set to a small amount, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 11/43: fec: LDPC cleaning up comments, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 30/43: grc: clean-up 'gnuradio-companion', add mode 'run from source', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 12/43: fec: re-shuffling LDPC make helper, git, 2015/04/02