24#ifndef LELY_UTIL_STOP_H_
25#define LELY_UTIL_STOP_H_
59#define STOP_FUNC_INIT(func) \
This header file is part of the utilities library; it contains the singly-linked list declarations.
int stop_token_insert(stop_token_t *token, struct stop_func *func)
Registers a callback function with the specified stop token.
void stop_token_release(stop_token_t *token)
Releases a reference to a stop token.
int stop_source_request_stop(stop_source_t *source)
Issues a stop request to the stop-state associated with the specified stop source,...
stop_token_t * stop_source_get_token(stop_source_t *source)
Returns (a reference to) a stop token associated with the specified stop source's stop-state.
stop_source_t * stop_source_acquire(stop_source_t *source)
Acquires a reference to a stop source.
void stop_source_release(stop_source_t *source)
Releases a reference to a stop source.
int stop_source_stop_requested(const stop_source_t *source)
Checks if the stop-state associated with the specified stop source has received a stop request.
void stop_token_remove(stop_token_t *token, struct stop_func *func)
Deregisters a callback function from the specified stop token.
int stop_token_stop_possible(const stop_token_t *token)
Checks if the stop-state associated with the specified stop token has received a stop request,...
stop_source_t * stop_source_create(void)
Creates a stop source with a new stop-state.
int stop_token_stop_requested(const stop_token_t *token)
Checks if the stop-state associated with the specified stop token has received a stop request.
stop_token_t * stop_token_acquire(stop_token_t *token)
Acquires a reference to a stop token.
A node in a singly-linked list.
An object providing the means to register a callback function with an stop_token_t object.
void(* func)(struct stop_func *func)
The function to be invoked when a stop request is issued.