pr_id(player, C_INIT, "Empire server ready\n");
- while (!io_eof(player->iop) && !io_error(player->iop)) {
+ while (!io_eof(player->iop) && !io_error(player->iop)
+ && player->state != PS_SHUTDOWN) {
io_output(player->iop, IO_WAIT);
if (io_gets(player->iop, buf, sizeof(buf)) < 0) {
io_input(player->iop, IO_WAIT);
default:
break;
}
- if (player->state >= PS_SHUTDOWN)
- break;
}
player->state = PS_SHUTDOWN;
if (!io_eof(player->iop)) {
/*continue; */
for (p = player_next(0); p != 0; p = player_next(p)) {
if (p->state == PS_SHUTDOWN) {
- /* no more mr. nice guy */
- p->state = PS_KILL;
- p->aborted++;
+ /* player thread hung */
+ /* FIXME but for how long? unknown if shut down elsewhere! */
+ /* FIXME this can leave stale update_lock behind! */
empth_terminate(p->proc);
p = player_delete(p);
continue;