Commit 8057fb5735547358e8c8e3f4486ab49394b2e6b0

Authored by Charles Otto
1 parent 6a7b6b64

Create resources proportional to Globals->parallelism

Expose Globals in resource.h, initialize Resource objects with
Globals->parallelism resources, rather than idealThreadCount
Showing 1 changed file with 2 additions and 1 deletions
openbr/core/resource.h
... ... @@ -24,6 +24,7 @@
24 24 #include <QSharedPointer>
25 25 #include <QString>
26 26 #include <QThread>
  27 +#include <openbr/openbr_plugin.h>
27 28  
28 29 template <typename T>
29 30 class ResourceMaker
... ... @@ -52,7 +53,7 @@ public:
52 53 : resourceMaker(rm)
53 54 , availableResources(new QList<T*>())
54 55 , lock(new QMutex())
55   - , totalResources(new QSemaphore(QThread::idealThreadCount()))
  56 + , totalResources(new QSemaphore(br::Globals->parallelism))
56 57 {}
57 58  
58 59 ~Resource()
... ...