Skip to content

Commit

Permalink
reword comment about order of adding waitables
Browse files Browse the repository at this point in the history
The old comment only mentioned times, but this applies to the other waitables as well.
  • Loading branch information
hoffmann-stefan committed Apr 15, 2024
1 parent 84aa569 commit 7b94df8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rcldotnet/RCLdotnet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,14 +1221,17 @@ public static void SpinOnce(Node node, long timeout)
WaitSetAddGuardCondition(waitSetHandle, guardCondition.Handle);
}

// Add timers to WaitSet before action clients and servers.
// As ActionClient and ActionServer also register timers internally,
// the order of adding them to the WaitSet has to match the execution order
foreach (var timer in node.Timers)
{
WaitSetAddTimer(waitSetHandle, timer.Handle);
}

// Action clients and servers need to be registerd after all the
// others that are handled by
// RCLdotnetDelegates.native_rcl_wait_set_*_ready methods, as
// they track indexes of the given waitables. Adding action
// clients and action servers before will get those indexes
// mixed up.
foreach (var actionClient in node.ActionClients)
{
WaitSetAddActionClient(waitSetHandle, actionClient.Handle);
Expand Down

0 comments on commit 7b94df8

Please sign in to comment.