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
This commit is contained in:
parent
753bcb5c34
commit
049c3b6cdf
@ -138,8 +138,11 @@ sblock(struct sockbuf *sb, int flags)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (flags == M_WAITOK) {
|
if (flags == M_WAITOK) {
|
||||||
sx_xlock(&sb->sb_sx);
|
if (sb->sb_flags & SB_NOINTR) {
|
||||||
return (0);
|
sx_xlock(&sb->sb_sx);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
return (sx_xlock_sig(&sb->sb_sx));
|
||||||
} else {
|
} else {
|
||||||
if (sx_try_xlock(&sb->sb_sx) == 0)
|
if (sx_try_xlock(&sb->sb_sx) == 0)
|
||||||
return (EWOULDBLOCK);
|
return (EWOULDBLOCK);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user