PipeWire 1.4.1
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
thread.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2021 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef PIPEWIRE_THREAD_H
6#define PIPEWIRE_THREAD_H
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#include <string.h>
13#include <errno.h>
14
15#include <spa/support/thread.h>
16
28void pw_thread_utils_set(struct spa_thread_utils *impl);
30void *pw_thread_fill_attr(const struct spa_dict *props, void *attr);
31
32#ifndef PW_API_THREAD_IMPL
33#define PW_API_THREAD_IMPL static inline
34#endif
35
37 const struct spa_dict *props, void *(*start_routine)(void*), void *arg)
39 return spa_thread_utils_create(pw_thread_utils_get(), props, start_routine, arg);
40}
41PW_API_THREAD_IMPL int pw_thread_utils_join(struct spa_thread *thread, void **retval)
42{
43 return spa_thread_utils_join(pw_thread_utils_get(), thread, retval);
44}
45PW_API_THREAD_IMPL int pw_thread_utils_get_rt_range(const struct spa_dict *props, int *min, int *max)
47 return spa_thread_utils_get_rt_range(pw_thread_utils_get(), props, min, max);
48}
49PW_API_THREAD_IMPL int pw_thread_utils_acquire_rt(struct spa_thread *thread, int priority)
56}
57
62#ifdef __cplusplus
63} /* extern "C" */
64#endif
65
66#endif /* PIPEWIRE_THREAD_H */
void * pw_thread_fill_attr(const struct spa_dict *props, void *attr)
Definition thread.c:50
struct spa_thread_utils * pw_thread_utils_get(void)
Definition thread.c:179
void pw_thread_utils_set(struct spa_thread_utils *impl)
Definition thread.c:173
PW_API_THREAD_IMPL int pw_thread_utils_drop_rt(struct spa_thread *thread)
Definition thread.h:58
PW_API_THREAD_IMPL int pw_thread_utils_get_rt_range(const struct spa_dict *props, int *min, int *max)
Definition thread.h:50
PW_API_THREAD_IMPL struct spa_thread * pw_thread_utils_create(const struct spa_dict *props, void *(*start_routine)(void *), void *arg)
Definition thread.h:41
PW_API_THREAD_IMPL int pw_thread_utils_acquire_rt(struct spa_thread *thread, int priority)
Definition thread.h:54
PW_API_THREAD_IMPL int pw_thread_utils_join(struct spa_thread *thread, void **retval)
Definition thread.h:46
#define PW_API_THREAD_IMPL
Definition thread.h:38
SPA_API_THREAD int spa_thread_utils_drop_rt(struct spa_thread_utils *o, struct spa_thread *thread)
drop realtime priority
Definition thread.h:121
SPA_API_THREAD int spa_thread_utils_acquire_rt(struct spa_thread_utils *o, struct spa_thread *thread, int priority)
acquire realtime priority, a priority of -1 refers to the priority configured in the realtime module
Definition thread.h:111
SPA_API_THREAD int spa_thread_utils_get_rt_range(struct spa_thread_utils *o, const struct spa_dict *props, int *min, int *max)
get realtime priority range for threads created with props
Definition thread.h:101
SPA_API_THREAD struct spa_thread * spa_thread_utils_create(struct spa_thread_utils *o, const struct spa_dict *props, void *(*start_routine)(void *), void *arg)
create a new thread that runs start with arg
Definition thread.h:81
SPA_API_THREAD int spa_thread_utils_join(struct spa_thread_utils *o, struct spa_thread *thread, void **retval)
stop and join a thread
Definition thread.h:91
#define SPA_DEPRECATED
Definition defs.h:301
spa/support/thread.h
spa/utils/string.h
Definition dict.h:51
Definition thread.h:55