update.h is a more logical home for update_running than server.h.
Move the definition and the assignments along, from server/update.c to
lib/update/main.c.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
extern int shutdown_pending;
extern empth_rwlock_t *update_lock;
extern empth_rwlock_t *shutdown_lock;
-extern int update_running;
extern time_t update_time[UPDATE_TIME_LEN];
void market_init(void);
};
/* main.c */
+extern int update_running;
extern struct budget nat_budget[MAXNOC];
/* age.c */
#include "optlist.h"
#include "player.h"
#include "prototypes.h"
-#include "server.h"
#include "unit.h"
#include "update.h"
#include "plane.h"
#include "player.h"
#include "prototypes.h"
-#include "server.h"
#include "unit.h"
#include "update.h"
#include "player.h"
#include "proto.h"
#include "prototypes.h"
-#include "server.h"
+#include "update.h"
#include "xy.h"
static void pr_player(struct player *pl, int id, char *buf);
#include "optlist.h"
#include "player.h"
#include "prototypes.h"
-#include "server.h"
+#include "update.h"
void
setrel(natid us, natid them, int rel)
#include "player.h"
#include "prototypes.h"
#include "sect.h"
-#include "server.h"
#include "update.h"
#include "xy.h"
#include "optlist.h"
#include "player.h"
#include "prototypes.h"
-#include "server.h"
#include "ship.h"
#include "unit.h"
#include "update.h"
#include "optlist.h"
#include "player.h"
#include "prototypes.h"
-#include "server.h"
#include "tel.h"
+#include "update.h"
static struct telstr last_tel[MAXNOC];
#include "unit.h"
#include "update.h"
+/*
+ * Update is running.
+ * Can be used to suppress messages, or direct them to bulletins.
+ */
+int update_running;
+
struct budget nat_budget[MAXNOC];
void
int i;
struct natstr *np;
+ update_running = 1;
logerror("production update (%d etus)", etu);
getrusage(RUSAGE_SELF, &rus1);
game_record_update(time(NULL));
- (rus1.ru_utime.tv_sec + rus1.ru_utime.tv_usec / 1e6),
rus2.ru_stime.tv_sec + rus2.ru_stime.tv_usec / 1e6
- (rus1.ru_stime.tv_sec + rus1.ru_stime.tv_usec / 1e6));
+ update_running = 0;
}
#include "prototypes.h"
#include "server.h"
-/*
- * Update is running.
- * Can be used to suppress messages, or direct them to bulletins.
- */
-int update_running;
-
static time_t update_schedule_anchor;
static int update_wanted;
return;
}
}
- update_running = 1;
update_main();
- update_running = 0;
empth_rwlock_unlock(update_lock);
}