]> git.pond.sub.org Git - empserver/commit
(pr_player, upr_player): Blocking I/O on another player's struct iop *
authorRon Koenderink <rkoenderink@yahoo.ca>
Mon, 4 Jul 2005 14:07:31 +0000 (14:07 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Mon, 4 Jul 2005 14:07:31 +0000 (14:07 +0000)
commit42a3ce3958357cf1bf0681b9147c8a646299dcc9
treee833e8390411ea1333b5c990ce5d87057b93fcbb
parent4ea137e8877a18dbd930762a4af6beda7f8b0343
(pr_player, upr_player): Blocking I/O on another player's struct iop *
is unsafe!  By the time the blocked thread wakes up, that player may
be gone, along with its struct iop *, and io_write() follows a
dangling pointer.  Moreover, at most one thread may use empth_select()
on the same file descriptor.  Violations of that restriction cause
threads to hang under Windows since ntthread.c rev. 1.15.  Make all
output to another player non-blocking for now.  Historically, player
threads sent output only to their socket, though their own iop.  This
was broken by flash and asynchronous telegram notification a long time
ago.
src/lib/subs/pr.c