PipeWire  0.3.61
Thread

Threading utility interfaces. More...

Files

file  thread.h
 spa/support/thread.h
 

Data Structures

struct  spa_thread_utils
 
struct  spa_thread_utils_methods
 thread utils More...
 
struct  spa_thread
 

Macros

#define SPA_TYPE_INFO_Thread   SPA_TYPE_INFO_POINTER_BASE "Thread"
 a thread object. More...
 
#define SPA_TYPE_INTERFACE_ThreadUtils   SPA_TYPE_INFO_INTERFACE_BASE "ThreadUtils"
 
#define SPA_VERSION_THREAD_UTILS   0
 
#define SPA_VERSION_THREAD_UTILS_METHODS   0
 
#define SPA_KEY_THREAD_NAME   "thread.name" /* the thread name */
 
#define SPA_KEY_THREAD_STACK_SIZE   "thread.stack-size" /* the stack size of the thread */
 

Functions

static struct spa_threadspa_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 More...
 
static int spa_thread_utils_join (struct spa_thread_utils *o, struct spa_thread *thread, void **retval)
 stop and join a thread More...
 
static 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 More...
 
static 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 More...
 
static int spa_thread_utils_drop_rt (struct spa_thread_utils *o, struct spa_thread *thread)
 drop realtime priority More...
 

Detailed Description

Threading utility interfaces.

Macro Definition Documentation

◆ SPA_TYPE_INFO_Thread

#define SPA_TYPE_INFO_Thread   SPA_TYPE_INFO_POINTER_BASE "Thread"

a thread object.

This can be cast to a platform native thread, like pthread on posix systems

◆ SPA_TYPE_INTERFACE_ThreadUtils

#define SPA_TYPE_INTERFACE_ThreadUtils   SPA_TYPE_INFO_INTERFACE_BASE "ThreadUtils"

◆ SPA_VERSION_THREAD_UTILS

#define SPA_VERSION_THREAD_UTILS   0

◆ SPA_VERSION_THREAD_UTILS_METHODS

#define SPA_VERSION_THREAD_UTILS_METHODS   0

◆ SPA_KEY_THREAD_NAME

#define SPA_KEY_THREAD_NAME   "thread.name" /* the thread name */

◆ SPA_KEY_THREAD_STACK_SIZE

#define SPA_KEY_THREAD_STACK_SIZE   "thread.stack-size" /* the stack size of the thread */

Function Documentation

◆ spa_thread_utils_create()

static struct spa_thread* spa_thread_utils_create ( struct spa_thread_utils o,
const struct spa_dict props,
void *(*)(void *)  start_routine,
void *  arg 
)
inlinestatic

create a new thread that runs start with arg

See also
spa_thread_utils_methods.create

◆ spa_thread_utils_join()

static int spa_thread_utils_join ( struct spa_thread_utils o,
struct spa_thread thread,
void **  retval 
)
inlinestatic

stop and join a thread

See also
spa_thread_utils_methods.join

◆ spa_thread_utils_get_rt_range()

static int spa_thread_utils_get_rt_range ( struct spa_thread_utils o,
const struct spa_dict props,
int *  min,
int *  max 
)
inlinestatic

get realtime priority range for threads created with props

See also
spa_thread_utils_methods.get_rt_range

◆ spa_thread_utils_acquire_rt()

static int spa_thread_utils_acquire_rt ( struct spa_thread_utils o,
struct spa_thread thread,
int  priority 
)
inlinestatic

acquire realtime priority, a priority of -1 refers to the priority configured in the realtime module

See also
spa_thread_utils_methods.acquire_rt

◆ spa_thread_utils_drop_rt()

static int spa_thread_utils_drop_rt ( struct spa_thread_utils o,
struct spa_thread thread 
)
inlinestatic

drop realtime priority

See also
spa_thread_utils_methods.drop_rt