summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan G Rennison <j.g.rennison@gmail.com>2019-03-10 19:20:11 +0000
committerPatric Stout <github@truebrain.nl>2020-12-22 15:17:57 +0100
commit7f0fefddcfbf4b16f22ec58b5cf3eac794ded43e (patch)
tree85f92331ee7fd1df4dfa82e7865c4799c2470d4d
parent0c5dc5d41eff0ac0a62dd67882a718bb3c99ec3a (diff)
downloadopenttd-7f0fefddcfbf4b16f22ec58b5cf3eac794ded43e.tar.xz
Change: [Linkgraph] Only acquire thread join performance measurements on network clients
Network servers and single player clients do not block on thread joins due to instead pausing shortly before the join is due.
-rw-r--r--src/linkgraph/linkgraphschedule.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/linkgraph/linkgraphschedule.cpp b/src/linkgraph/linkgraphschedule.cpp
index 2638b77ea..87ab4818a 100644
--- a/src/linkgraph/linkgraphschedule.cpp
+++ b/src/linkgraph/linkgraphschedule.cpp
@@ -15,6 +15,7 @@
#include "flowmapper.h"
#include "../framerate_type.h"
#include "../command_func.h"
+#include "../network/network.h"
#include "../safeguards.h"
@@ -206,8 +207,13 @@ void OnTick_LinkGraph()
if (offset == 0) {
LinkGraphSchedule::instance.SpawnNext();
} else if (offset == _settings_game.linkgraph.recalc_interval / 2) {
- PerformanceMeasurer framerate(PFE_GL_LINKGRAPH);
- LinkGraphSchedule::instance.JoinNext();
+ if (!_networking || _network_server) {
+ PerformanceMeasurer::SetInactive(PFE_GL_LINKGRAPH);
+ LinkGraphSchedule::instance.JoinNext();
+ } else {
+ PerformanceMeasurer framerate(PFE_GL_LINKGRAPH);
+ LinkGraphSchedule::instance.JoinNext();
+ }
}
}