PipeWire: thread-loop.c File Reference

PipeWire 0.3.34

Macros | Functions
thread-loop.c File Reference

## Macros
#define | NAME "thread-loop"
#define | pw_thread_loop_events_emit(o, m, v, ...) spa_hook_list_call(&o->listener_list, struct pw_thread_loop_events, m, v, ##__VA_ARGS__)
#define | pw_thread_loop_events_destroy(o) pw_thread_loop_events_emit(o, destroy, 0)
#define | CHECK(expression, label)

## Functions
struct pw_thread_loop * | pw_thread_loop_new (const char *name, const struct spa_dict *props)
| Create a new PipeWire Threaded Loop Object. More...
struct pw_thread_loop * | pw_thread_loop_new_full (struct pw_loop *loop, const char *name, const struct spa_dict *props)
| Create a new PipeWire Threaded Loop Object. More...
void | pw_thread_loop_destroy (struct pw_thread_loop *loop)
| Destroy a threaded loop. More...
void | pw_thread_loop_add_listener (struct pw_thread_loop *loop, struct spa_hook *listener, const struct pw_thread_loop_events *events, void *data)
| Add an event listener. More...
struct pw_loop * | pw_thread_loop_get_loop (struct pw_thread_loop *loop)
| Get the loop implementation of the thread loop. More...
int | pw_thread_loop_start (struct pw_thread_loop *loop)
| Start the thread to handle loop. More...
void | pw_thread_loop_stop (struct pw_thread_loop *loop)
| Quit the loop and stop its thread. More...
void | pw_thread_loop_lock (struct pw_thread_loop *loop)
| Lock the mutex associated with loop. More...
void | pw_thread_loop_unlock (struct pw_thread_loop *loop)
| Unlock the mutex associated with loop. More...
void | pw_thread_loop_signal (struct pw_thread_loop *loop, bool wait_for_accept)
| Signal the thread. More...
void | pw_thread_loop_wait (struct pw_thread_loop *loop)
| Wait for the loop thread to call pw_thread_loop_signal() More...
int | pw_thread_loop_timed_wait (struct pw_thread_loop *loop, int wait_max_sec)
| Wait for the loop thread to call pw_thread_loop_signal() or time out. More...
int | pw_thread_loop_get_time (struct pw_thread_loop *loop, struct timespec *abstime, int64_t timeout)
| Get the current time of the loop + timeout. More...
int | pw_thread_loop_timed_wait_full (struct pw_thread_loop *loop, struct timespec *abstime)
| Wait for the loop thread to call pw_thread_loop_signal() or time out. More...
void | pw_thread_loop_accept (struct pw_thread_loop *loop)
| Signal the loop thread waiting for accept with pw_thread_loop_signal() More...
bool | pw_thread_loop_in_thread (struct pw_thread_loop *loop)
| Check if we are inside the thread of the loop. More...

## Macro Definition Documentation

## ◆ CHECK

#define CHECK | ( |  | expression,
|  |  | label
| ) |  |

Value:
do { \
if ((errno = expression) != 0) { \
res = -errno; \
pw_log_error(#expression ": %s", strerror(errno)); \
goto label; \
} \
} while(false);

## ◆ NAME

#define NAME "thread-loop"

## ◆ pw_thread_loop_events_destroy

#define pw_thread_loop_events_destroy | ( |  | o | ) | pw_thread_loop_events_emit(o, destroy, 0)

## ◆ pw_thread_loop_events_emit

#define pw_thread_loop_events_emit | ( |  | o,
|  |  | m,
|  |  | v,
|  |  | ...
| ) |  | spa_hook_list_call(&o->listener_list, struct pw_thread_loop_events, m, v, ##__VA_ARGS__)