parent
da4e5767c2
commit
293aee7843
2 changed files with 7 additions and 7 deletions
|
@ -41,7 +41,7 @@ typedef struct rcl_wait_set_impl_t
|
||||||
rmw_clients_t rmw_clients;
|
rmw_clients_t rmw_clients;
|
||||||
size_t service_index;
|
size_t service_index;
|
||||||
rmw_services_t rmw_services;
|
rmw_services_t rmw_services;
|
||||||
rmw_waitset_t * rmw_waitset;
|
rmw_wait_set_t * rmw_wait_set;
|
||||||
size_t timer_index;
|
size_t timer_index;
|
||||||
rcl_allocator_t allocator;
|
rcl_allocator_t allocator;
|
||||||
} rcl_wait_set_impl_t;
|
} rcl_wait_set_impl_t;
|
||||||
|
@ -143,10 +143,10 @@ rcl_wait_set_init(
|
||||||
wait_set->impl->rmw_services.services = NULL;
|
wait_set->impl->rmw_services.services = NULL;
|
||||||
wait_set->impl->rmw_services.service_count = 0;
|
wait_set->impl->rmw_services.service_count = 0;
|
||||||
|
|
||||||
wait_set->impl->rmw_waitset = rmw_create_waitset(
|
wait_set->impl->rmw_wait_set = rmw_create_wait_set(
|
||||||
2 * number_of_subscriptions + number_of_guard_conditions + number_of_clients +
|
2 * number_of_subscriptions + number_of_guard_conditions + number_of_clients +
|
||||||
number_of_services);
|
number_of_services);
|
||||||
if (!wait_set->impl->rmw_waitset) {
|
if (!wait_set->impl->rmw_wait_set) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ rcl_wait_set_init(
|
||||||
return RCL_RET_OK;
|
return RCL_RET_OK;
|
||||||
fail:
|
fail:
|
||||||
if (__wait_set_is_valid(wait_set)) {
|
if (__wait_set_is_valid(wait_set)) {
|
||||||
rmw_ret_t ret = rmw_destroy_waitset(wait_set->impl->rmw_waitset);
|
rmw_ret_t ret = rmw_destroy_wait_set(wait_set->impl->rmw_wait_set);
|
||||||
if (ret != RMW_RET_OK) {
|
if (ret != RMW_RET_OK) {
|
||||||
fail_ret = RCL_RET_WAIT_SET_INVALID;
|
fail_ret = RCL_RET_WAIT_SET_INVALID;
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ rcl_wait_set_fini(rcl_wait_set_t * wait_set)
|
||||||
RCL_CHECK_ARGUMENT_FOR_NULL(wait_set, RCL_RET_INVALID_ARGUMENT, rcl_get_default_allocator());
|
RCL_CHECK_ARGUMENT_FOR_NULL(wait_set, RCL_RET_INVALID_ARGUMENT, rcl_get_default_allocator());
|
||||||
|
|
||||||
if (__wait_set_is_valid(wait_set)) {
|
if (__wait_set_is_valid(wait_set)) {
|
||||||
rmw_ret_t ret = rmw_destroy_waitset(wait_set->impl->rmw_waitset);
|
rmw_ret_t ret = rmw_destroy_wait_set(wait_set->impl->rmw_wait_set);
|
||||||
if (ret != RMW_RET_OK) {
|
if (ret != RMW_RET_OK) {
|
||||||
RCL_SET_ERROR_MSG(rmw_get_error_string_safe(), wait_set->impl->allocator);
|
RCL_SET_ERROR_MSG(rmw_get_error_string_safe(), wait_set->impl->allocator);
|
||||||
result = RCL_RET_WAIT_SET_INVALID;
|
result = RCL_RET_WAIT_SET_INVALID;
|
||||||
|
@ -598,7 +598,7 @@ rcl_wait(rcl_wait_set_t * wait_set, int64_t timeout)
|
||||||
&wait_set->impl->rmw_guard_conditions,
|
&wait_set->impl->rmw_guard_conditions,
|
||||||
&wait_set->impl->rmw_services,
|
&wait_set->impl->rmw_services,
|
||||||
&wait_set->impl->rmw_clients,
|
&wait_set->impl->rmw_clients,
|
||||||
wait_set->impl->rmw_waitset,
|
wait_set->impl->rmw_wait_set,
|
||||||
timeout_argument);
|
timeout_argument);
|
||||||
|
|
||||||
// Items that are not ready will have been set to NULL by rmw_wait.
|
// Items that are not ready will have been set to NULL by rmw_wait.
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(CLASSNAME(WaitSetTestFixture, RMW_IMPLEMENTATION), test_resize_to_zero) {
|
TEST_F(CLASSNAME(WaitSetTestFixture, RMW_IMPLEMENTATION), test_resize_to_zero) {
|
||||||
// Initialize a waitset with a subscription and then resize it to zero.
|
// Initialize a wait set with a subscription and then resize it to zero.
|
||||||
rcl_wait_set_t wait_set = rcl_get_zero_initialized_wait_set();
|
rcl_wait_set_t wait_set = rcl_get_zero_initialized_wait_set();
|
||||||
rcl_ret_t ret = rcl_wait_set_init(&wait_set, 1, 0, 0, 0, 0, rcl_get_default_allocator());
|
rcl_ret_t ret = rcl_wait_set_init(&wait_set, 1, 0, 0, 0, 0, rcl_get_default_allocator());
|
||||||
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
|
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue