Skip to content

Commit

Permalink
Start NUClear thread tasks first as they are often needed by the thre…
Browse files Browse the repository at this point in the history
…ad pool tasks that come after
  • Loading branch information
TrentHouliston committed Nov 5, 2019
1 parent e54ceca commit b923cad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/PowerPlant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ void PowerPlant::start() {
// Direct emit startup event
emit<dsl::word::emit::Direct>(std::make_unique<dsl::word::Startup>());

// Start all our threads
for (size_t i = 0; i < configuration.thread_count; ++i) {
tasks.push_back(threading::make_thread_pool_task(scheduler));
}

// Start all our tasks
for (auto& task : tasks) {
threads.push_back(std::make_unique<std::thread>(task));
}

// Start all our threads
for (size_t i = 0; i < configuration.thread_count; ++i) {
tasks.push_back(threading::make_thread_pool_task(scheduler));
}

// Start our main thread using our main task scheduler
threading::make_thread_pool_task(main_thread_scheduler)();

Expand Down

0 comments on commit b923cad

Please sign in to comment.