Start player thread shutdown grace time at shutdwn() entry
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 27 Mar 2012 17:21:38 +0000 (19:21 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 26 Apr 2012 17:57:19 +0000 (19:57 +0200)
Before, it was started after all commands aborted.  Shouldn't make a
difference in practice, as command abortion is supposed to be quick.

src/server/main.c

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