(update_lock, play_lock, update_pending, play_wrlock_wanted): Move to

main.c and rename to better reflect their purpose.  Fix misleading
comments.
This commit is contained in:
Markus Armbruster 2007-07-20 19:09:34 +00:00
parent d4150cc2ee
commit a9afd1efef
5 changed files with 31 additions and 29 deletions

View file

@ -324,9 +324,9 @@ io_output_all(struct iop *iop)
* Mustn't block a player thread while update is pending, or else
* a malicous player could delay the update indefinitely
*/
while (((n = io_output(iop, IO_NOWAIT)) > 0) && !update_pending) {
while ((n = io_output(iop, IO_NOWAIT)) > 0 && !play_wrlock_wanted)
empth_select(iop->fd, EMPTH_FD_WRITE);
}
return n;
}

View file

@ -88,7 +88,7 @@ dispatch(char *buf, char *redir)
pr("Command not implemented\n");
return 0;
}
empth_rwlock_rdlock(update_lock);
empth_rwlock_rdlock(play_lock);
if (redir) {
prredir(redir);
uprnf(buf);
@ -110,7 +110,7 @@ dispatch(char *buf, char *redir)
logerror("%s: returned bad value", command->c_form);
break;
}
empth_rwlock_unlock(update_lock);
empth_rwlock_unlock(play_lock);
player->command = 0;
return 0;
}