summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-08-04 16:26:26 +0200
committerRobin Gareus <robin@gareus.org>2017-08-04 16:26:26 +0200
commit1ed9564ffd2145ab290903d73a8cc774147c5432 (patch)
tree33392c07ab1b25d588deecc08a16aeeded2cbaa2 /libs/pbd
parent38c5e9de6df4bc4ca52c53e31759bcdfe9fccd3d (diff)
Graph profiling: allow to override max DSP thread count & calc avg.
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/cpus.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/pbd/cpus.cc b/libs/pbd/cpus.cc
index 69421e5e92..f43b128da1 100644
--- a/libs/pbd/cpus.cc
+++ b/libs/pbd/cpus.cc
@@ -22,6 +22,8 @@
#include "libpbd-config.h"
#endif
+#include <stdlib.h>
+
#ifdef __linux__
#include <unistd.h>
#elif defined(__APPLE__) || defined(__FreeBSD__)
@@ -41,6 +43,12 @@
uint32_t
hardware_concurrency()
{
+ if (getenv("CONCURRENCY")) {
+ int c = atoi (getenv("CONCURRENCY"));
+ if (c > 0) {
+ return c;
+ }
+ }
#if defined(PTW32_VERSION) || defined(__hpux)
return pthread_num_processors_np();
#elif defined(__APPLE__)