Ardour  9.0-pre0-350-gf17a656217
pthread_utils.h File Reference
#include <pthread.h>
#include <signal.h>
#include <string>
#include <stdint.h>
#include "pbd/libpbd_visibility.h"
#include "pbd/signals.h"
Include dependency graph for pthread_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PBD::Thread
 

Namespaces

 PBD
 

Macros

#define PTHREAD_MACROS_DEFINED
 
#define mark_pthread_inactive(threadID)   threadID=0
 
#define is_pthread_active(threadID)   threadID!=0
 
#define PBD_RT_STACKSIZE_PROC   0x80000
 
#define PBD_RT_STACKSIZE_HELP   0x08000
 
#define PBD_RT_PRI_MAIN   pbd_pthread_priority (THREAD_MAIN)
 
#define PBD_RT_PRI_MIDI   pbd_pthread_priority (THREAD_MIDI)
 
#define PBD_RT_PRI_PROC   pbd_pthread_priority (THREAD_PROC)
 
#define PBD_RT_PRI_CTRL   pbd_pthread_priority (THREAD_CTRL)
 
#define PBD_RT_PRI_IOFX   pbd_pthread_priority (THREAD_IOFX)
 
#define PBD_SCHED_FIFO   SCHED_FIFO
 

Enumerations

enum  PBDThreadClass {
  THREAD_MAIN , THREAD_MIDI , THREAD_PROC , THREAD_CTRL ,
  THREAD_IOFX
}
 

Functions

int pthread_create_and_store (std::string name, pthread_t *thread, void *(*start_routine)(void *), void *arg, uint32_t stacklimit=0x80000)
 
void pthread_cancel_one (pthread_t thread)
 
void pthread_cancel_all ()
 
void pthread_kill_all (int signum)
 
const char * pthread_name ()
 
void pthread_set_name (const char *name)
 
void pbd_set_engine_rt_priority (int)
 
int pbd_pthread_priority (PBDThreadClass)
 
int pbd_pthread_create (const size_t stacksize, pthread_t *thread, void *(*start_routine)(void *), void *arg)
 
int pbd_realtime_pthread_create (std::string const &debug_name, const int policy, int priority, const size_t stacksize, pthread_t *thread, void *(*start_routine)(void *), void *arg)
 
int pbd_absolute_rt_priority (int policy, int priority)
 
int pbd_set_thread_priority (pthread_t, int policy, int priority)
 
bool pbd_mach_set_realtime_policy (pthread_t thread_id, double period_ns, bool main)
 
void PBD::notify_event_loops_about_thread_creation (pthread_t, const std::string &, int requests=256)
 

Variables

PBD::Signal< void(pthread_t, std::string, uint32_t)> PBD::ThreadCreatedWithRequestSize
 

Macro Definition Documentation

◆ is_pthread_active

#define is_pthread_active (   threadID)    threadID!=0

Definition at line 35 of file pthread_utils.h.

◆ mark_pthread_inactive

#define mark_pthread_inactive (   threadID)    threadID=0

Definition at line 34 of file pthread_utils.h.

◆ PBD_RT_PRI_CTRL

#define PBD_RT_PRI_CTRL   pbd_pthread_priority (THREAD_CTRL)

Definition at line 60 of file pthread_utils.h.

◆ PBD_RT_PRI_IOFX

#define PBD_RT_PRI_IOFX   pbd_pthread_priority (THREAD_IOFX)

Definition at line 61 of file pthread_utils.h.

◆ PBD_RT_PRI_MAIN

#define PBD_RT_PRI_MAIN   pbd_pthread_priority (THREAD_MAIN)

Definition at line 57 of file pthread_utils.h.

◆ PBD_RT_PRI_MIDI

#define PBD_RT_PRI_MIDI   pbd_pthread_priority (THREAD_MIDI)

Definition at line 58 of file pthread_utils.h.

◆ PBD_RT_PRI_PROC

#define PBD_RT_PRI_PROC   pbd_pthread_priority (THREAD_PROC)

Definition at line 59 of file pthread_utils.h.

◆ PBD_RT_STACKSIZE_HELP

#define PBD_RT_STACKSIZE_HELP   0x08000

Definition at line 52 of file pthread_utils.h.

◆ PBD_RT_STACKSIZE_PROC

#define PBD_RT_STACKSIZE_PROC   0x80000

Definition at line 51 of file pthread_utils.h.

◆ PBD_SCHED_FIFO

#define PBD_SCHED_FIFO   SCHED_FIFO

Definition at line 136 of file pthread_utils.h.

◆ PTHREAD_MACROS_DEFINED

#define PTHREAD_MACROS_DEFINED

Definition at line 29 of file pthread_utils.h.

Enumeration Type Documentation

◆ PBDThreadClass

Enumerator
THREAD_MAIN 
THREAD_MIDI 
THREAD_PROC 
THREAD_CTRL 
THREAD_IOFX 

Definition at line 72 of file pthread_utils.h.

Function Documentation

◆ pbd_absolute_rt_priority()

int pbd_absolute_rt_priority ( int  policy,
int  priority 
)

◆ pbd_mach_set_realtime_policy()

bool pbd_mach_set_realtime_policy ( pthread_t  thread_id,
double  period_ns,
bool  main 
)

◆ pbd_pthread_create()

int pbd_pthread_create ( const size_t  stacksize,
pthread_t *  thread,
void *(*)(void *)  start_routine,
void *  arg 
)

◆ pbd_pthread_priority()

int pbd_pthread_priority ( PBDThreadClass  )

◆ pbd_realtime_pthread_create()

int pbd_realtime_pthread_create ( std::string const &  debug_name,
const int  policy,
int  priority,
const size_t  stacksize,
pthread_t *  thread,
void *(*)(void *)  start_routine,
void *  arg 
)

◆ pbd_set_engine_rt_priority()

void pbd_set_engine_rt_priority ( int  )

◆ pbd_set_thread_priority()

int pbd_set_thread_priority ( pthread_t  ,
int  policy,
int  priority 
)

◆ pthread_cancel_all()

void pthread_cancel_all ( )

◆ pthread_cancel_one()

void pthread_cancel_one ( pthread_t  thread)

◆ pthread_create_and_store()

int pthread_create_and_store ( std::string  name,
pthread_t *  thread,
void *(*)(void *)  start_routine,
void *  arg,
uint32_t  stacklimit = 0x80000 
)

◆ pthread_kill_all()

void pthread_kill_all ( int  signum)

◆ pthread_name()

const char* pthread_name ( )

◆ pthread_set_name()

void pthread_set_name ( const char *  name)