Lock the writer socket across sorwakeup(fip->fi_writesock).

Spotted by:	peter
This commit is contained in:
Seigo Tanimura 2002-05-21 02:37:56 +00:00
parent 743f138e8d
commit 102638407c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97035

View File

@ -224,11 +224,13 @@ fifo_open(ap)
if (fip->fi_writers == 1) {
SOCK_LOCK(fip->fi_readsock);
fip->fi_readsock->so_state &= ~SS_CANTRCVMORE;
SOCK_UNLOCK(fip->fi_readsock);
if (fip->fi_readers > 0) {
wakeup((caddr_t)&fip->fi_readers);
SOCK_LOCK(fip->fi_writesock);
sorwakeup(fip->fi_writesock);
SOCK_UNLOCK(fip->fi_writesock);
}
SOCK_UNLOCK(fip->fi_readsock);
}
}
if ((ap->a_mode & FREAD) && (ap->a_mode & O_NONBLOCK) == 0) {