Skip to content
Permalink
Browse files

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.
  • Loading branch information
JGRennison committed Mar 10, 2019
1 parent 278c6b7 commit a5697ddeeb43c64ae6cac25581022efcf8e107bd
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/linkgraph/linkgraphschedule.cpp
@@ -17,6 +17,7 @@
#include "flowmapper.h"
#include "../framerate_type.h"
#include "../command_func.h"
#include "../network/network.h"

#include "../safeguards.h"

@@ -210,8 +211,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();
}
}
}

0 comments on commit a5697dd

Please sign in to comment.
You can’t perform that action at this time.