21 #ifndef __pbd_pthread_utils__
22 #define __pbd_pthread_utils__
28 #ifndef PTHREAD_MACROS_DEFINED
29 #define PTHREAD_MACROS_DEFINED
31 #define mark_pthread_inactive(threadID) threadID.p=0
32 #define is_pthread_active(threadID) threadID.p!=0
34 #define mark_pthread_inactive(threadID) threadID=0
35 #define is_pthread_active(threadID) threadID!=0
40 #include <ardourext/pthread.h>
51 #define PBD_RT_STACKSIZE_PROC 0x80000
52 #define PBD_RT_STACKSIZE_HELP 0x08000
57 # define PBD_RT_PRI_MAIN pbd_pthread_priority (THREAD_MAIN)
58 # define PBD_RT_PRI_MIDI pbd_pthread_priority (THREAD_MIDI)
59 # define PBD_RT_PRI_PROC pbd_pthread_priority (THREAD_PROC)
60 # define PBD_RT_PRI_CTRL pbd_pthread_priority (THREAD_CTRL)
61 # define PBD_RT_PRI_IOFX pbd_pthread_priority (THREAD_IOFX)
83 const size_t stacksize,
85 void *(*start_routine) (
void *),
90 std::string
const& debug_name,
91 const int policy,
int priority,
const size_t stacksize,
93 void *(*start_routine) (
void *),
113 Thread (std::function<
void ()>
const&, std::string
const&
name =
"");
133 #ifdef PLATFORM_WINDOWS
134 #define PBD_SCHED_FIFO SCHED_OTHER
136 #define PBD_SCHED_FIFO SCHED_FIFO
static Thread * create(std::function< void()> const &, std::string const &name)
bool caller_is_self() const
static void * _run(void *)
Thread(std::function< void()> const &, std::string const &name="")
std::function< void()> _slot
GtkImageIconNameData name
void notify_event_loops_about_thread_creation(pthread_t, const std::string &, int requests=256)
PBD::Signal< void(pthread_t, std::string, uint32_t)> ThreadCreatedWithRequestSize
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)
void pthread_kill_all(int signum)
void pbd_set_engine_rt_priority(int)
bool pbd_mach_set_realtime_policy(pthread_t thread_id, double period_ns, bool main)
void pthread_cancel_one(pthread_t thread)
int pbd_pthread_create(const size_t stacksize, pthread_t *thread, void *(*start_routine)(void *), void *arg)
int pbd_pthread_priority(PBDThreadClass)
const char * pthread_name()
int pthread_create_and_store(std::string name, pthread_t *thread, void *(*start_routine)(void *), void *arg, uint32_t stacklimit=0x80000)
int pbd_set_thread_priority(pthread_t, int policy, int priority)
int pbd_absolute_rt_priority(int policy, int priority)
void pthread_cancel_all()
void pthread_set_name(const char *name)