Function rmw_compare_gids_equal
Defined in File rmw.h
Function Documentation
-
rmw_ret_t rmw_compare_gids_equal(const rmw_gid_t *gid1, const rmw_gid_t *gid2, bool *result)
Check if two unique identifiers (gids) are equal.
Attribute
Adherence
Allocates Memory
No
Thread-Safe
Yes
Uses Atomics
Maybe [1]
Lock-Free
Maybe [1]
[1] implementation defined, check implementation documentation.
- Thread-safety
Unique identifier comparison is a reentrant function, but:
Access to both gids is read-only but it is not synchronized. Concurrent
gid1
andgid2
reads are safe, but concurrent reads and writes are not.Access to primitive data-type arguments is not synchronized. It is not safe to read or write
result
while rmw_compare_gids_equal() uses it.
- Parameters:
gid1 – [in] First unique identifier to compare.
gid2 – [in] Second unique identifier to compare.
result – [out] true if both gids are equal, false otherwise.
- Returns:
RMW_RET_OK
if successful, or- Returns:
RMW_RET_INVALID_ARGUMENT
ifgid1
orgid2
is NULL, or- Returns:
RMW_RET_INCORRECT_RMW_IMPLEMENTATION
if the implementation identifier ofgid1
orgid2
does not match this implementation, or- Returns:
RMW_RET_ERROR
if an unspecified error occurs.