diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-05-31 11:51:22 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-05-31 11:51:22 +0000 |
commit | 7f276f0bff169823b786ea0a9bbdfe936361fcb4 (patch) | |
tree | 0fa5537dba9120510dc50f16c105ce1607f601aa /sys/kern/uipc_sockbuf.c | |
parent | 7b9e23fdf95884dff25d4a11574c946c775145d7 (diff) | |
download | FreeBSD-src-7f276f0bff169823b786ea0a9bbdfe936361fcb4.zip FreeBSD-src-7f276f0bff169823b786ea0a9bbdfe936361fcb4.tar.gz |
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
Diffstat (limited to 'sys/kern/uipc_sockbuf.c')
-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 25d9200..1b1e271 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); |