#include "empthread.h"
#include "file.h"
#include "journal.h"
-#include "land.h"
#include "match.h"
#include "misc.h"
-#include "nat.h"
-#include "nuke.h"
#include "optlist.h"
#include "plane.h"
#include "player.h"
#include "prototypes.h"
#include "sect.h"
#include "server.h"
-#include "ship.h"
#include "version.h"
static void ignore(void);
{
struct player *p;
time_t now;
- int i, queues_drained;
+ int i;
logerror("Shutdown commencing (cleaning up threads.)");
now = time(NULL);
empth_yield();
- for (i = 1; i <= 3; i++) {
- queues_drained = 1;
- for (p = player_next(NULL); p; p = player_next(p)) {
- if (io_outputwaiting(p->iop))
- queues_drained = 0;
- }
- if (queues_drained)
- break;
- logerror("Waiting for player output to drain\n");
+ for (i = 1; i <= 3 && player_next(NULL); i++) {
+ logerror("Waiting for player threads to terminate\n");
empth_sleep(now + i);
}
- for (p = player_next(NULL); p; p = player_next(p)) {
- if (io_outputwaiting(p->iop))
- logerror("Output for player %d lost", p->cnum);
- }
+ for (p = player_next(NULL); p; p = player_next(p))
+ logerror("Player %d lingers, output might be lost", p->cnum);
if (sig)
logerror("Server shutting down on signal %d", sig);