Function rmw_create_wait_set

Function Documentation

rmw_wait_set_t *rmw_create_wait_set(rmw_context_t *context, size_t max_conditions)

Create a wait set to store conditions that the middleware can wait on.

This function can fail, and therefore return NULL, if:

  • context is NULL

  • context is zero initialized, as provided by rmw_get_zero_initialized_context()

  • context does not belong to this implementation i.e. does not have a matching implementation identifier

  • memory allocation fails during wait set creation

  • an unspecified error occurs

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

Yes

Uses Atomics

Maybe [1]

Lock-Free

Maybe [1]

[1] rmw implementation defined, check the implementation documentation

Thread-safety

Contexts are thread-safe objects, and so are all operations on them except for finalization. Therefore, it is safe to create multiple wait sets in the same context concurrently.

Parameters:
  • context[in] Context to associate the wait set with.

  • max_conditions[in] The maximum number of conditions that can be attached to, and stored by, the wait set. Can be set to zero (0) for the wait set to support an unbounded number of conditions.

Pre:

Given context must be a valid context, initialized by rmw_init().

Returns:

An rmw wait set, or NULL if an error occurred.