diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2005-05-27 17:16:43 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2005-05-27 17:16:43 +0000 |
commit | 83b3d58d05950fb3624050f521e508893a7292d0 (patch) | |
tree | 212ed0d493f97d1aaaf87cd6d83c3c5ddeb00898 /sys/kern/uipc_socket2.c | |
parent | 0cb7166f7811047c2d42add2b62e7169f968dc72 (diff) | |
download | src-83b3d58d05950fb3624050f521e508893a7292d0.tar.gz src-83b3d58d05950fb3624050f521e508893a7292d0.zip |
Notes
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r-- | sys/kern/uipc_socket2.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 0db83df4b6a7..cb1a24c481c9 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -159,15 +159,12 @@ soisdisconnecting(so) { /* - * XXXRW: This code separately acquires SOCK_LOCK(so) and - * SOCKBUF_LOCK(&so->so_rcv) even though they are the same mutex to - * avoid introducing the assumption that they are the same. + * XXXRW: This code assumes that SOCK_LOCK(so) and + * SOCKBUF_LOCK(&so->so_rcv) are the same. */ - SOCK_LOCK(so); + SOCKBUF_LOCK(&so->so_rcv); so->so_state &= ~SS_ISCONNECTING; so->so_state |= SS_ISDISCONNECTING; - SOCK_UNLOCK(so); - SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_state |= SBS_CANTRCVMORE; sorwakeup_locked(so); SOCKBUF_LOCK(&so->so_snd); @@ -182,16 +179,12 @@ soisdisconnected(so) { /* - * XXXRW: This code separately acquires SOCK_LOCK(so) and - * SOCKBUF_LOCK(&so->so_rcv) even though they are the same mutex to - * avoid introducing the assumption that they are the same. + * XXXRW: This code assumes that SOCK_LOCK(so) and + * SOCKBUF_LOCK(&so->so_rcv) are the same. */ - /* XXXRW: so_state locking? */ - SOCK_LOCK(so); + SOCKBUF_LOCK(&so->so_rcv); so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); so->so_state |= SS_ISDISCONNECTED; - SOCK_UNLOCK(so); - SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_state |= SBS_CANTRCVMORE; sorwakeup_locked(so); SOCKBUF_LOCK(&so->so_snd); |