PipeWire: pipewire/thread.h Source File

PipeWire 1.4.2 |

Loading...
Searching...
No Matches
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
21
26
27 SPA_DEPRECATED
28void pw_thread_utils_set(struct spa_thread_utils *impl);
29struct spa_thread_utils *pw_thread_utils_get(void);
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
36 PW_API_THREAD_IMPL struct spa_thread *pw_thread_utils_create(
37 const struct spa_dict *props, void *(*start_routine)(void*), void *arg)
38{
39 return spa_thread_utils_create(pw_thread_utils_get(), props, start_routine, arg);
40}
41 PW_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}
45 PW_API_THREAD_IMPL int pw_thread_utils_get_rt_range(const struct spa_dict *props, int *min, int *max)
46{
47 return spa_thread_utils_get_rt_range(pw_thread_utils_get(), props, min, max);
48}
49 PW_API_THREAD_IMPL int pw_thread_utils_acquire_rt(struct spa_thread *thread, int priority)
50{
51 return spa_thread_utils_acquire_rt(pw_thread_utils_get(), thread, priority);
52}
53 PW_API_THREAD_IMPL int pw_thread_utils_drop_rt(struct spa_thread *thread)
54{
55 return spa_thread_utils_drop_rt(pw_thread_utils_get(), thread);
56}
57
58
58/**
59 * \}
60 */
61
62#ifdef __cplusplus
63} /* extern "C" */
64#endif
65
66#endif /* PIPEWIRE_THREAD_H */
pw_thread_fill_attr
void * pw_thread_fill_attr(const struct spa_dict *props, void *attr)
Definition thread.c:50
pw_thread_utils_get
struct spa_thread_utils * pw_thread_utils_get(void)
Definition thread.c:179
pw_thread_utils_set
void pw_thread_utils_set(struct spa_thread_utils *impl)
Definition thread.c:173
pw_thread_utils_drop_rt
PW_API_THREAD_IMPL int pw_thread_utils_drop_rt(struct spa_thread *thread)
Definition thread.h:58
pw_thread_utils_get_rt_range
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_thread_utils_create
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_thread_utils_acquire_rt
PW_API_THREAD_IMPL int pw_thread_utils_acquire_rt(struct spa_thread *thread, int priority)
Definition thread.h:54
pw_thread_utils_join
PW_API_THREAD_IMPL int pw_thread_utils_join(struct spa_thread *thread, void **retval)
Definition thread.h:46
PW_API_THREAD_IMPL
#define PW_API_THREAD_IMPL
Definition thread.h:38
spa_thread_utils_drop_rt
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_thread_utils_acquire_rt
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_thread_utils_get_rt_range
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_thread_utils_create
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_thread_utils_join
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
SPA_DEPRECATED
#define SPA_DEPRECATED
Definition defs.h:301
thread.h
spa/support/thread.h
string.h
spa/utils/string.h
spa_dict
Definition dict.h:51
spa_thread_utils
Definition thread.h:55
spa_thread