empserver/include
Markus Armbruster 0a4d77e919 Simplify checks whether player thread may sleep
A player thread may sleep on input or output, except:

(1) While it is executing a C_MOD command, it may only sleep on input.

(2) While it is being aborted by the update or shutdown, it may not
    sleep at all.

To find out whether a player thread may sleep on input, code has to
check condition (2).  It needs do to that in recvclient().

To find out whether it may sleep on output, it has to check both
conditions.  It needs to do that in pr_player() and upr_player().

The code tracked condition (1) in global variable play_lock_wanted.
It checked condition (2) by examining struct player member command.

Replace all that by new struct player member may_sleep.  Initialize it
in player_new(), update it in dispatch(), shutdwn() and update_run().
This makes the tests in recvclient(), pr_player() and upr_player()
obvious.  play_wrlock_wanted() is now unused, remove it.
2009-11-30 19:43:18 +01:00
..
budg.h Make sector maintenance cost configurable 2009-07-19 13:58:47 -04:00
com.h Update copyright notice 2009-02-08 09:33:18 +01:00
combat.h Update copyright notice 2009-02-08 09:33:18 +01:00
commands.h Update copyright notice 2009-02-08 09:33:18 +01:00
commodity.h Update copyright notice 2009-02-08 09:33:18 +01:00
damage.h Update copyright notice 2009-02-08 09:33:18 +01:00
distribute.h Update copyright notice 2009-02-08 09:33:18 +01:00
econfig-spec.h Update copyright notice 2009-02-08 09:33:18 +01:00
empio.h Move queue flush out of io.c 2009-07-19 14:11:53 -04:00
empobj.h Update copyright notice 2009-02-08 09:33:18 +01:00
empthread.h Make empth_rwlock_t prefer writers 2009-07-19 14:11:52 -04:00
file.h Update copyright notice 2009-02-08 09:33:18 +01:00
game.h Update known contributors comments 2009-02-18 21:11:33 +01:00
ioqueue.h Hide struct io and implementation of struct ioqueue 2009-07-19 14:11:52 -04:00
item.h Update copyright notice 2009-02-08 09:33:18 +01:00
journal.h Update copyright notice 2009-02-08 09:33:18 +01:00
land.h Update copyright notice 2009-02-08 09:33:18 +01:00
loan.h Update copyright notice 2009-02-08 09:33:18 +01:00
lost.h Update copyright notice 2009-02-08 09:33:18 +01:00
lwp.h Update known contributors comments 2009-02-18 21:11:33 +01:00
map.h Update copyright notice 2009-02-08 09:33:18 +01:00
match.h Update copyright notice 2009-02-08 09:33:18 +01:00
misc.h Update copyright notice 2009-02-08 09:33:18 +01:00
mission.h Update copyright notice 2009-02-08 09:33:18 +01:00
nat.h Update known contributors comments 2009-02-18 21:11:33 +01:00
news.h Update copyright notice 2009-02-08 09:33:18 +01:00
nsc.h Update copyright notice 2009-02-08 09:33:18 +01:00
nuke.h Update copyright notice 2009-02-08 09:33:18 +01:00
optlist.h Update copyright notice 2009-02-08 09:33:18 +01:00
path.h Update copyright notice 2009-02-08 09:33:18 +01:00
plague.h Update copyright notice 2009-02-08 09:33:18 +01:00
plane.h Update known contributors comments 2009-02-18 21:11:33 +01:00
player.h Simplify checks whether player thread may sleep 2009-11-30 19:43:18 +01:00
power.h Update copyright notice 2009-02-08 09:33:18 +01:00
product.h Update copyright notice 2009-02-08 09:33:18 +01:00
proto.h Update copyright notice 2009-02-08 09:33:18 +01:00
prototypes.h Rename plane_caps() to pln_caps() and give it external linkage 2009-03-08 17:14:59 +01:00
queue.h Update copyright notice 2009-02-08 09:33:18 +01:00
retreat.h Update copyright notice 2009-02-08 09:33:18 +01:00
sect.h Make sector maintenance cost configurable 2009-07-19 13:58:47 -04:00
server.h Simplify checks whether player thread may sleep 2009-11-30 19:43:18 +01:00
service.h Update copyright notice 2009-02-08 09:33:18 +01:00
ship.h Update copyright notice 2009-02-08 09:33:18 +01:00
tel.h Update known contributors comments 2009-02-18 21:11:33 +01:00
trade.h Update copyright notice 2009-02-08 09:33:18 +01:00
treaty.h Update copyright notice 2009-02-08 09:33:18 +01:00
types.h Update copyright notice 2009-02-08 09:33:18 +01:00
unit.h Update copyright notice 2009-02-08 09:33:18 +01:00
update.h Update copyright notice 2009-02-08 09:33:18 +01:00
version.h Update copyright notice 2009-02-08 09:33:18 +01:00
xdump.h Update copyright notice 2009-02-08 09:33:18 +01:00
xy.h Update copyright notice 2009-02-08 09:33:18 +01:00