]> git.pond.sub.org Git - empserver/commit
Fix player thread race with update_init()
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 28 Apr 2009 21:06:16 +0000 (23:06 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 30 Nov 2009 18:43:47 +0000 (19:43 +0100)
commitf5885865da43c62ae7fefc0a1da550a0462fb51c
tree6f0130456ac3df5598af235b87169034d43fd016
parent0a4d77e919028c54f5e99fdc883ec04bae92d882
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().
src/server/main.c