@@ -47,8 +47,11 @@ namespace DynamicExecutor {
4747 class SCISHARE ModuleConsumer : boost::noncopyable
4848 {
4949 public:
50- explicit ModuleConsumer (ModuleWorkQueuePtr workQueue, const Networks::ExecutableLookup* lookup, ProducerInterfacePtr producer) :
51- work_(workQueue), producer_(producer), lookup_(lookup), shouldLog_(SCIRun::Core::Logging::Log::get().verbose())
50+ explicit ModuleConsumer (ModuleWorkQueuePtr workQueue, const Networks::ExecutableLookup* lookup, ProducerInterfacePtr producer,
51+ boost::thread_group& executeThreadGroup) :
52+ work_(workQueue), producer_(producer), lookup_(lookup),
53+ executeThreadGroup_(executeThreadGroup),
54+ shouldLog_(SCIRun::Core::Logging::Log::get().verbose())
5255 {
5356 log_.setVerbose (shouldLog_);
5457 if (shouldLog_)
@@ -86,7 +89,7 @@ namespace DynamicExecutor {
8689
8790 ModuleExecutor executor (unit, lookup_, producer_);
8891 // / @todo: thread pool
89- threads_ .create_thread (boost::bind (&ModuleExecutor::run, executor));
92+ executeThreadGroup_ .create_thread (boost::bind (&ModuleExecutor::run, executor));
9093 }
9194 else
9295 {
@@ -107,7 +110,7 @@ namespace DynamicExecutor {
107110 ModuleWorkQueuePtr work_;
108111 ProducerInterfacePtr producer_;
109112 const Networks::ExecutableLookup* lookup_;
110- mutable boost::thread_group threads_ ;
113+ boost::thread_group& executeThreadGroup_ ;
111114
112115 static Core::Logging::Log& log_;
113116 bool shouldLog_;
0 commit comments