(market_init): New.
(start_server): Call it. Move initialization stuff to it, with error checking added. (market_update): Internal linkage.
This commit is contained in:
parent
02584d8a50
commit
f41e44fb74
3 changed files with 14 additions and 7 deletions
|
@ -47,7 +47,7 @@ void mobility_init(void);
|
|||
|
||||
/* thread entry points */
|
||||
void delete_lostitems(void *);
|
||||
void market_update(void *);
|
||||
void market_init(void);
|
||||
void mobility_check(void *);
|
||||
void player_kill_idle(void *);
|
||||
void update_main(void);
|
||||
|
|
|
@ -333,11 +333,7 @@ start_server(int flags)
|
|||
"MobilityCheck", "Writes the timestamp file", 0);
|
||||
}
|
||||
|
||||
if (opt_MARKET) {
|
||||
empth_create(PP_TIMESTAMP, market_update, (50 * 1024), flags,
|
||||
"MarketUpdate", "Updates the market", 0);
|
||||
}
|
||||
|
||||
market_init();
|
||||
update_init();
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include "empthread.h"
|
||||
#include "file.h"
|
||||
#include "optlist.h"
|
||||
#include "player.h"
|
||||
#include "prototypes.h"
|
||||
#include "server.h"
|
||||
|
@ -64,7 +65,7 @@ check_all_markets(void *unused)
|
|||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
static void
|
||||
market_update(void *unused)
|
||||
{
|
||||
time_t now;
|
||||
|
@ -85,3 +86,13 @@ market_update(void *unused)
|
|||
}
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
void
|
||||
market_init(void)
|
||||
{
|
||||
if (!opt_MARKET)
|
||||
return;
|
||||
if (!empth_create(PP_TIMESTAMP, market_update, 50 * 1024, 0,
|
||||
"MarketUpdate", "Updates the market", NULL))
|
||||
exit_nomem();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue