Changeset - r24484:e4eb01747c4c
[Not reviewed]
master
0 1 0
Jonathan G Rennison - 5 years ago 2019-03-10 19:20:11
j.g.rennison@gmail.com
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.
1 file changed with 8 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/linkgraph/linkgraphschedule.cpp
Show inline comments
 
@@ -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();
 
		}
 
	}
 
}
 

	
0 comments (0 inline, 0 general)