Files @ r24484:e4eb01747c4c
Branch filter:

Location: cpp/openttd-patchpack/source/src/linkgraph/init.h

Jonathan G Rennison
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.
/** @file init.h Declaration of initializing link graph handler. */

#ifndef INIT_H
#define INIT_H

#include "linkgraphjob_base.h"

/**
 * Stateless, thread safe initialization handler. Initializes node and edge
 * annotations.
 */
class InitHandler : public ComponentHandler {
public:

	/**
	 * Initialize the link graph job.
	 * @param job Job to be initialized.
	 */
	virtual void Run(LinkGraphJob &job) const { job.Init(); }

	/**
	 * Virtual destructor has to be defined because of virtual Run().
	 */
	virtual ~InitHandler() {}
};

#endif /* INIT_H */