Skip to content

Commit 7670ac9

Browse files
authored
Spin session on empty wait (#233)
* Update Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Update Signed-off-by: Pablo Garrido <pablogs9@gmail.com> * Update Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
1 parent f2cccfe commit 7670ac9

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

rmw_microxrcedds_c/src/rmw_wait.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include <rmw/rmw.h>
1919
#include <rmw/time.h>
20+
#include <uxr/client/core/session/session.h>
2021

2122
#include "./rmw_microros_internal/utils.h"
2223

@@ -108,6 +109,14 @@ rmw_wait(
108109
}
109110
item = item->next;
110111
}
112+
} else {
113+
// Spin with no blocking to handle session metatraffic
114+
item = session_memory.allocateditems;
115+
while (item != NULL) {
116+
rmw_context_impl_t * custom_context = (rmw_context_impl_t *)item->data;
117+
uxr_run_session_timeout(&custom_context->session, 0);
118+
item = item->next;
119+
}
111120
}
112121

113122
UXR_UNLOCK(&rmw_uxrce_wait_mutex);

0 commit comments

Comments
 (0)