Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emerge threads aren't started for two seconds for no reason #11837

Closed
appgurueu opened this issue Dec 5, 2021 · 3 comments · Fixed by #11815
Closed

Emerge threads aren't started for two seconds for no reason #11837

appgurueu opened this issue Dec 5, 2021 · 3 comments · Fixed by #11815
Labels
Bug Issues that were confirmed to be a bug

Comments

@appgurueu
Copy link
Contributor

server.cpp:

	/*
		Trigger emergethread (it somehow gets to a non-triggered but
		bysy state sometimes)
	*/
	{
		float &counter = m_emergethread_trigger_timer;
		counter += dtime;
		if (counter >= 2.0) {
			counter = 0.0;

			m_emerge->startThreads();
		}
	}

After the first call, which takes 2s to happen, the event manager will set a flag to true; all subsequent calls are no-ops. The call should be done instantaneously, without a timer, and ideally outside of the game loop.

@appgurueu appgurueu added the Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible label Dec 5, 2021
@sfan5
Copy link
Member

sfan5 commented Dec 5, 2021

The comment suggests this is a workaround for the emerge thread sometimes getting stuck so I expected there to be a m_emerge->startThreads() somewhere else but there doesn't seem to be one.

@sfan5 sfan5 added Bug Issues that were confirmed to be a bug and removed Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible labels Dec 5, 2021
@erlehmann
Copy link
Contributor

@celeron55 can you please explain the purpose of the 2 second delay introduced in 2010 in the commit c707e00? The commit message is “sitä sun tätä tekeillä, toimii kivasti”.

@celeron55
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants