grc: function probe waits for flowgraph initialization

Wait until the flowgraph is done initializing before running the
probe loop. The real problem had to do with referencing a
variable that may not have been created yet, due to the ordering
of autogenerated code. Waiting until the flowgraph has been started
ensures that everything has been initialized.

Signed-off-by: Jeff Long <willcode4@gmail.com>
This commit is contained in:
Jeff Long 2024-05-23 12:12:48 -04:00
parent 697fcbf14c
commit e5b06f6ef5

View File

@ -33,6 +33,7 @@ templates:
var_make: self.${id} = ${id} = ${value}
make: |+
def _${id}_probe():
self.flowgraph_started.wait()
while True:
<% obj = 'self' + ('.' + block_id if block_id else '') %>
val = ${obj}.${function_name}(${function_args})