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:
parent
0a4d77e919
commit
f5885865da
1 changed files with 1 additions and 2 deletions
|
@ -375,10 +375,9 @@ start_server(int flags)
|
|||
if (journal_startup() < 0)
|
||||
exit(1);
|
||||
|
||||
empth_create(player_accept, 50 * 1024, flags, "AcceptPlayers", NULL);
|
||||
|
||||
market_init();
|
||||
update_init();
|
||||
empth_create(player_accept, 50 * 1024, flags, "AcceptPlayers", NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue