diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2007-05-31 11:51:22 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2007-05-31 11:51:22 +0000 |
commit | 049c3b6cdf6ad1566ed35d869341a2c4b4c0b76e (patch) | |
tree | 0fa5537dba9120510dc50f16c105ce1607f601aa /sys | |
parent | 753bcb5c34b8154a18bfacbbe26a3c60cf572838 (diff) | |
download | src-049c3b6cdf6ad1566ed35d869341a2c4b4c0b76e.tar.gz src-049c3b6cdf6ad1566ed35d869341a2c4b4c0b76e.zip |
Now that sx(9) locks support an interruptible lock acquire primitive,
properly observe the SB_NOINTR flag in sblock. This restores the
required behavior that lock acquisition be interruptible on the socket
buffer I/O serialization lock to allow threads waiting for I/O to be
signaled even if they aren't the thread currently holding the I/O lock.
With this change, the sblock regression test is again passed.
Reported by: alfred
sx(9) handiwork: attilio
Notes
Notes:
svn path=/head/; revision=170151
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_sockbuf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 25d9200f5d35..1b1e27158094 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -138,8 +138,11 @@ sblock(struct sockbuf *sb, int flags) { if (flags == M_WAITOK) { - sx_xlock(&sb->sb_sx); - return (0); + if (sb->sb_flags & SB_NOINTR) { + sx_xlock(&sb->sb_sx); + return (0); + } + return (sx_xlock_sig(&sb->sb_sx)); } else { if (sx_try_xlock(&sb->sb_sx) == 0) return (EWOULDBLOCK); |