Function rmw_context_fini
Defined in File init.h
Function Documentation
-
rmw_ret_t rmw_context_fini(rmw_context_t *context)
Finalize a context.
This function will return early if a logical error, such as
RMW_RET_INVALID_ARGUMENT
orRMW_RET_INCORRECT_RMW_IMPLEMENTATION
, ensues, leaving the given context unchanged. Otherwise, it will proceed despite errors, freeing as much resources as it can and zero initializing the given context.Attribute
Adherence
Allocates Memory
Yes
Thread-Safe
No
Uses Atomics
Yes
Lock-Free
Yes [1]
Remark
If context is zero initialized, then
RMW_RET_INVALID_ARGUMENT
is returned. If context is initialized and valid (rmw_shutdown()
was not called on it), thenRMW_RET_INVALID_ARGUMENT
is returned.This should be defined by the rmw implementation.
- Pre:
The context to be finalized must have been previously initialized with
rmw_init()
, and then later invalidated withrmw_shutdown()
.- Returns:
RMW_RET_OK
if successful, or- Returns:
RMW_RET_INVALID_ARGUMENT
if any arguments are invalid, or- Returns:
RMW_RET_INCORRECT_RMW_IMPLEMENTATION
if the implementation identifier does not match, or- Returns:
RMW_RET_ERROR
if an unspecified error occur.