Drop the socket buffer lock around a call to m_copym() with M_TRYWAIT.

A subset of locking changes to soreceive() in the queue for merging.

Bumped into by:	Willem Jan Withagen <wjw@withagen.nl>
This commit is contained in:
rwatson 2004-07-05 19:29:33 +00:00
parent ed2c20329c
commit 01ce51e897

View File

@ -1148,8 +1148,11 @@ soreceive(so, psa, uio, mp0, controlp, flagsp)
if (flags & MSG_PEEK)
moff += len;
else {
if (mp != NULL)
if (mp != NULL) {
SOCKBUF_UNLOCK(&so->so_rcv);
*mp = m_copym(m, 0, len, M_TRYWAIT);
SOCKBUF_LOCK(&so->so_rcv);
}
m->m_data += len;
m->m_len -= len;
so->so_rcv.sb_cc -= len;