Function rclc_executor_spin_one_period

Function Documentation

rcl_ret_t rclc_executor_spin_one_period(rclc_executor_t *executor, const uint64_t period)

The reason for splitting up the rclc_executor_spin_period function, is only to write a unit test for testing the accuracy of the period duration.

The rclc_executor_spin_period is an endless loop, therefore it is not possible to stop after x iterations. The function rclc_executor_spin_one_period implements one iteration. The unit test for rclc_executor_spin_period covers only rclc_executor_spin_one_period.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • executor[inout] pointer to initialized executor

  • period[in] in nanoseconds

Returns:

RCL_RET_OK if spin operation was successful

Returns:

RCL_RET_INVALID_ARGUMENT if executor is a null pointer

Returns:

RCL_RET_ERROR if any other error occured