Synchronize commands and update properly with a lock (towards

resolving #1458175 and #1504036):
(update_lock): New.
(update_shed): Initialize it.
(update_wait, dispatch): Take exclusive update_lock around the update,
shared update_lock around commands.  This makes the update block until
all aborted commands terminated and gave up their lock.  Remove the
cheesy and unsafe two second wait for commands to finish.  It also
makes player threads block before executing commands while the update
is pending, removing the need to fail commands then.  So don't.
This commit is contained in:
Markus Armbruster 2007-01-15 19:57:26 +00:00
parent 0c52f203c0
commit 6cbdd3e02a
3 changed files with 13 additions and 14 deletions

View file

@ -39,6 +39,7 @@
extern int shutdown_pending;
extern int update_pending;
extern empth_sem_t *update_sem;
extern empth_rwlock_t *update_lock;
extern time_t update_time;
extern int updating_mob;