diff options
author | Robin Gareus <robin@gareus.org> | 2020-04-23 01:28:58 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-23 01:28:58 +0200 |
commit | 3d166c77891c2a83de35c5fd10c0b23c131bc43b (patch) | |
tree | 8aadfa6e479b07620598d954cf422c15c836d2c0 /libs/pbd | |
parent | 485ac454771a7ae5301524f9ba0a5adb28fbacf4 (diff) |
Consolidate stack-size and priority of rt-threads
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/pbd/pthread_utils.h | 10 | ||||
-rw-r--r-- | libs/pbd/pthread_utils.cc | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/libs/pbd/pbd/pthread_utils.h b/libs/pbd/pbd/pthread_utils.h index 3296d4471c..6eedbd95c8 100644 --- a/libs/pbd/pbd/pthread_utils.h +++ b/libs/pbd/pbd/pthread_utils.h @@ -48,6 +48,16 @@ #include "pbd/libpbd_visibility.h" #include "pbd/signals.h" +#define PBD_RT_STACKSIZE_PROC 0x20000 // 128kB +#define PBD_RT_STACKSIZE_HELP 0x08000 // 32kB + +/* these are relative to sched_get_priority_max() + * see pbd_absolute_rt_priority() + */ +#define PBD_RT_PRI_MAIN -20 +#define PBD_RT_PRI_MIDI -21 +#define PBD_RT_PRI_PROC -22 + LIBPBD_API int pthread_create_and_store (std::string name, pthread_t *thread, void * (*start_routine)(void *), void * arg); LIBPBD_API void pthread_cancel_one (pthread_t thread); LIBPBD_API void pthread_cancel_all (); diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc index f655dbd5b4..1d179f9cac 100644 --- a/libs/pbd/pthread_utils.cc +++ b/libs/pbd/pthread_utils.cc @@ -132,7 +132,7 @@ pthread_create_and_store (string name, pthread_t *thread, void * (*start_routin // set default stack size to sensible default for memlocking pthread_attr_init(&default_attr); - pthread_attr_setstacksize(&default_attr, 500000); + pthread_attr_setstacksize(&default_attr, 0x80000); // 512kB ThreadStartWithName* ts = new ThreadStartWithName (start_routine, arg, name); |