41 #ifndef LELY_EV_LOOP_H_
42 #define LELY_EV_LOOP_H_
50 #ifndef LELY_EV_LOOP_INLINE
51 #define LELY_EV_LOOP_INLINE static inline
61 void *ev_loop_alloc(
void);
62 void ev_loop_free(
void *ptr);
147 const struct timespec *abs_time);
172 const struct timespec *abs_time);
179 ev_loop_t *loop,
const struct timespec *abs_time);
186 ev_loop_t *loop,
const struct timespec *abs_time);
This header file is part of the event library; it contains the abstract polling interface.
const struct ev_poll_vtbl *const ev_poll_t
The abstract polling interface.
This header file is part of the event library; it contains the futures and promises declarations.
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
This header file is part of the C11 and POSIX compatibility library; it includes <time....
ev_exec_t * ev_loop_get_exec(const ev_loop_t *loop)
Returns a pointer to the executor corresponding to the event loop.
size_t ev_loop_run_one(ev_loop_t *loop)
Equivalent to ev_loop_wait_one(loop, NULL).
int ev_loop_kill(ev_loop_t *loop, void *thr)
Interrupts an event loop running on the specified thread.
size_t ev_loop_wait_one(ev_loop_t *loop, ev_future_t *future)
If the event loop has pending tasks, runs a single task.
void ev_loop_destroy(ev_loop_t *loop)
Destroys a polling event loop.
size_t ev_loop_poll(ev_loop_t *loop)
Equivalent to ev_loop_run_until(loop, NULL).
ev_poll_t * ev_loop_get_poll(const ev_loop_t *loop)
Returns a pointer to the polling instance used by the event loop, or NULL if the loop does not poll.
size_t ev_loop_poll_one(ev_loop_t *loop)
Equivalent to ev_loop_run_one_until(loop, NULL).
ev_loop_t * ev_loop_create(ev_poll_t *poll, size_t npoll, int poll_task)
Creates a new polling event loop.
void * ev_loop_self(void)
Returns the identifier of the calling thread.
size_t ev_loop_run_until(ev_loop_t *loop, const struct timespec *abs_time)
Equivalent to ev_loop_wait_until(loop, NULL, abs_time).
size_t ev_loop_run(ev_loop_t *loop)
Equivalent to ev_loop_wait(loop, NULL).
void ev_loop_stop(ev_loop_t *loop)
Stops the event loop.
size_t ev_loop_wait(ev_loop_t *loop, ev_future_t *future)
Equivalent to.
size_t ev_loop_wait_one_until(ev_loop_t *loop, ev_future_t *future, const struct timespec *abs_time)
If the event loop has pending tasks, runs a single task.
size_t ev_loop_wait_until(ev_loop_t *loop, ev_future_t *future, const struct timespec *abs_time)
Equivalent to.
size_t ev_loop_run_one_until(ev_loop_t *loop, const struct timespec *abs_time)
Equivalent to ev_loop_wait_one_until(loop, NULL, abs_time).
int ev_loop_stopped(const ev_loop_t *loop)
Returns 1 if the event loop is stopped, and 0 if not.
void ev_loop_restart(ev_loop_t *loop)
Restarts an event loop.
This header file is part of the C11 and POSIX compatibility library; it includes <stddef....
size_t npoll
The number of threads allowed to poll simultaneously.
ev_poll_t * poll
A pointer to the interface used to poll for events (can be NULL).