Skip to content

Commit

Permalink
Fix racing condition with null post-patch sites
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-f-cruz committed Jun 25, 2024
1 parent f084353 commit 0f3093d
Showing 1 changed file with 56 additions and 42 deletions.
98 changes: 56 additions & 42 deletions src/vr-foraging.bonsai
Original file line number Diff line number Diff line change
Expand Up @@ -8334,25 +8334,6 @@ Item2 as Start
<Name>Foraging</Name>
<Workflow>
<Nodes>
<Expression xsi:type="SubscribeSubject">
<Name>ActivePatch</Name>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>VirtualSiteGeneration.PostPatch</Selector>
</Expression>
<Expression xsi:type="scr:ExpressionTransform">
<scr:Name>IsNull</scr:Name>
<scr:Expression>it == null</scr:Expression>
</Expression>
<Expression xsi:type="BitwiseNot" />
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Take">
<rx:Count>1</rx:Count>
</Combinator>
</Expression>
<Expression xsi:type="rx:AsyncSubject">
<Name>HasPostPatch</Name>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="gl:Timer">
<gl:DueTime>PT0S</gl:DueTime>
Expand Down Expand Up @@ -8706,33 +8687,71 @@ Item2 as Start
<Name>HasNotPostPatch</Name>
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>HasPostPatch</Name>
<Name>ActivePatch</Name>
</Expression>
<Expression xsi:type="BitwiseAnd">
<Operand xsi:type="BooleanProperty">
<Value>false</Value>
</Operand>
<Expression xsi:type="MemberSelector">
<Selector>VirtualSiteGeneration.PostPatch</Selector>
</Expression>
<Expression xsi:type="scr:ExpressionTransform">
<scr:Name>IsNull</scr:Name>
<scr:Expression>it == null</scr:Expression>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:WithLatestFrom" />
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Item2</Selector>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="0" To="4" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="3" To="4" Label="Source2" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
</Edges>
</Workflow>
</Expression>
<Expression xsi:type="rx:Condition">
<Name>HasPostPatch</Name>
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>HasPostPatch</Name>
<Name>ActivePatch</Name>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>VirtualSiteGeneration.PostPatch</Selector>
</Expression>
<Expression xsi:type="scr:ExpressionTransform">
<scr:Name>IsNull</scr:Name>
<scr:Expression>it == null</scr:Expression>
</Expression>
<Expression xsi:type="BitwiseNot" />
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:WithLatestFrom" />
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Item2</Selector>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="0" To="5" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="4" To="5" Label="Source2" />
<Edge From="5" To="6" Label="Source1" />
<Edge From="6" To="7" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand Down Expand Up @@ -8844,27 +8863,22 @@ Item2 as Start
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="1" To="5" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="4" To="5" Label="Source2" />
<Edge From="5" To="6" Label="Source1" />
<Edge From="6" To="7" Label="Source1" />
<Edge From="7" To="11" Label="Source1" />
<Edge From="8" To="9" Label="Source1" />
<Edge From="6" To="8" Label="Source1" />
<Edge From="7" To="14" Label="Source1" />
<Edge From="8" To="12" Label="Source1" />
<Edge From="9" To="10" Label="Source1" />
<Edge From="10" To="11" Label="Source2" />
<Edge From="11" To="12" Label="Source1" />
<Edge From="10" To="11" Label="Source1" />
<Edge From="11" To="12" Label="Source2" />
<Edge From="12" To="13" Label="Source1" />
<Edge From="12" To="14" Label="Source1" />
<Edge From="13" To="20" Label="Source1" />
<Edge From="14" To="18" Label="Source1" />
<Edge From="13" To="14" Label="Source2" />
<Edge From="14" To="15" Label="Source1" />
<Edge From="15" To="16" Label="Source1" />
<Edge From="16" To="17" Label="Source1" />
<Edge From="17" To="18" Label="Source2" />
<Edge From="18" To="19" Label="Source1" />
<Edge From="19" To="20" Label="Source2" />
<Edge From="20" To="21" Label="Source1" />
<Edge From="21" To="22" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand Down

0 comments on commit 0f3093d

Please sign in to comment.