Function rcl_timer_cancel

Function Documentation

rcl_ret_t rcl_timer_cancel(rcl_timer_t *timer)

Cancel a timer.

When a timer is canceled, rcl_timer_is_ready() will return false for that timer, and rcl_timer_call() will fail with RCL_RET_TIMER_CANCELED.

A canceled timer can be reset with rcl_timer_reset(), and then used again. Calling this function on an already canceled timer will succeed.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

Yes

Uses Atomics

Yes

Lock-Free

Yes [1]

[1] if returns true for

Parameters:

timer[inout] the timer to be canceled

Returns:

RCL_RET_OK if the timer was canceled successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_TIMER_INVALID if the timer is invalid.