Fuse update wait thread and update thread:
(update_main): No longer a thread entry point. Remove the parameter. Remove *player setup. Don't terminate the thread when done. (update_pending): Move to src/server/update.c. (update_wait): Call update_main() instead of running it in its own thread. Set up *player for it. (update_init): Create the fused update thread instead of the update wait thread.
This commit is contained in:
parent
e7271e0a98
commit
02584d8a50
3 changed files with 20 additions and 39 deletions
|
@ -49,11 +49,8 @@ long lnd_money[MAXNOC];
|
|||
long air_money[MAXNOC];
|
||||
long tpops[MAXNOC];
|
||||
|
||||
int update_pending = 0;
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
update_main(void *unused)
|
||||
update_main(void)
|
||||
{
|
||||
int etu = etu_per_update;
|
||||
int n;
|
||||
|
@ -63,9 +60,6 @@ update_main(void *unused)
|
|||
struct natstr *cnp;
|
||||
struct natstr *np;
|
||||
|
||||
if (CANT_HAPPEN(!update_pending))
|
||||
update_pending = 1;
|
||||
|
||||
logerror("production update (%d etus)", etu);
|
||||
journal_update(etu);
|
||||
|
||||
|
@ -76,9 +70,6 @@ update_main(void *unused)
|
|||
mob_plane(etu);
|
||||
mob_land(etu);
|
||||
}
|
||||
player->proc = empth_self();
|
||||
player->cnum = 0;
|
||||
player->god = 1;
|
||||
|
||||
if (opt_AUTO_POWER)
|
||||
update_power();
|
||||
|
@ -180,9 +171,5 @@ update_main(void *unused)
|
|||
/* Clear all the telegram flags */
|
||||
for (cn = 0; cn < MAXNOC; cn++)
|
||||
clear_telegram_is_new(cn);
|
||||
update_pending = 0;
|
||||
logerror("End update");
|
||||
player_delete(player);
|
||||
empth_exit();
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue