How to use the threads.create function in threads

To help you get started, we’ve selected a few threads examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fatcerberus / miniSphere / assets / system / modules / maps / index.js View on Github external
function run(filename)
{
	if (_isActive)
		throw new Error("map engine is already running");

	_isActive = true;
	_threadID = threads.create({
		update:   _update,
		render:   _render,
		getInput: _getInput
	});
	threads.join(_threadID);
	_threadID = null;
}