Create NavMap thread pool only when it's used, to prevent creating excessive amount of running threads.
This commit is contained in:
parent
a8abdc9372
commit
40f0b23482
@ -673,6 +673,9 @@ void NavMap::compute_single_step(uint32_t index, RvoAgent **agent) {
|
|||||||
void NavMap::step(real_t p_deltatime) {
|
void NavMap::step(real_t p_deltatime) {
|
||||||
deltatime = p_deltatime;
|
deltatime = p_deltatime;
|
||||||
if (controlled_agents.size() > 0) {
|
if (controlled_agents.size() > 0) {
|
||||||
|
if (step_work_pool.get_thread_count() == 0) {
|
||||||
|
step_work_pool.init();
|
||||||
|
}
|
||||||
step_work_pool.do_work(
|
step_work_pool.do_work(
|
||||||
controlled_agents.size(),
|
controlled_agents.size(),
|
||||||
this,
|
this,
|
||||||
@ -720,7 +723,6 @@ void NavMap::clip_path(const std::vector<gd::NavigationPoly> &p_navigation_polys
|
|||||||
}
|
}
|
||||||
|
|
||||||
NavMap::NavMap() {
|
NavMap::NavMap() {
|
||||||
step_work_pool.init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NavMap::~NavMap() {
|
NavMap::~NavMap() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user