Fix player thread race with update_init()

start_server() creates the thread running player_accept() before it
calls update_init().  However, update_init() initializes stuff used to
player threads: update_time[] and play_lock.  In theory, a player
thread could start before that, and crash when taking the
uninitialized play_lock.

Delay starting that tread until after update_init().
This commit is contained in:
Markus Armbruster 2009-04-28 23:06:16 +02:00
parent 0a4d77e919
commit f5885865da

View file

@ -375,10 +375,9 @@ start_server(int flags)
if (journal_startup() < 0) if (journal_startup() < 0)
exit(1); exit(1);
empth_create(player_accept, 50 * 1024, flags, "AcceptPlayers", NULL);
market_init(); market_init();
update_init(); update_init();
empth_create(player_accept, 50 * 1024, flags, "AcceptPlayers", NULL);
} }
/* /*