Start player thread shutdown grace time at shutdwn() entry

Before, it was started after all commands aborted.  Shouldn't make a
difference in practice, as command abortion is supposed to be quick.
This commit is contained in:
Markus Armbruster 2012-03-27 19:21:38 +02:00
parent 786e2a99d5
commit 86f0294573

View file

@ -406,7 +406,7 @@ void
shutdwn(int sig) shutdwn(int sig)
{ {
struct player *p; struct player *p;
time_t now; time_t now = time(NULL);
int i; int i;
logerror("Shutdown commencing (cleaning up threads.)"); logerror("Shutdown commencing (cleaning up threads.)");
@ -425,7 +425,6 @@ shutdwn(int sig)
} }
empth_rwlock_wrlock(play_lock); empth_rwlock_wrlock(play_lock);
now = time(NULL);
empth_yield(); empth_yield();
for (i = 1; i <= 3 && player_next(NULL); i++) { for (i = 1; i <= 3 && player_next(NULL); i++) {
logerror("Waiting for player threads to terminate\n"); logerror("Waiting for player threads to terminate\n");