Rename socket wait channels when sleeping.
authorbluhm <bluhm@openbsd.org>
Thu, 25 Apr 2024 17:32:53 +0000 (17:32 +0000)
committerbluhm <bluhm@openbsd.org>
Thu, 25 Apr 2024 17:32:53 +0000 (17:32 +0000)
Use "netacc" for accept(2) and "netcon" for connect(2).  Call sleep
in sys_ypconnect() "ypcon" to make it unique.  sblock() now has
"sblock" to distinguish it from netlock.

OK claudio@ mvs@ kn@

sys/kern/uipc_socket2.c
sys/kern/uipc_syscalls.c

index 64eb921..7fe3df6 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: uipc_socket2.c,v 1.149 2024/04/11 13:32:51 mvs Exp $  */
+/*     $OpenBSD: uipc_socket2.c,v 1.150 2024/04/25 17:32:53 bluhm Exp $        */
 /*     $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $       */
 
 /*
@@ -559,7 +559,7 @@ sblock(struct socket *so, struct sockbuf *sb, int flags)
        while (sb->sb_flags & SB_LOCK) {
                sb->sb_flags |= SB_WANT;
                mtx_leave(&sb->sb_mtx);
-               error = sosleep_nsec(so, &sb->sb_flags, prio, "netlck", INFSLP);
+               error = sosleep_nsec(so, &sb->sb_flags, prio, "sblock", INFSLP);
                if (error)
                        return (error);
                mtx_enter(&sb->sb_mtx);
index 97690f8..1ad1b79 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: uipc_syscalls.c,v 1.218 2024/03/01 14:15:01 bluhm Exp $       */
+/*     $OpenBSD: uipc_syscalls.c,v 1.219 2024/04/25 17:32:53 bluhm Exp $       */
 /*     $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $      */
 
 /*
@@ -300,7 +300,7 @@ doaccept(struct proc *p, int sock, struct sockaddr *name, socklen_t *anamelen,
                        break;
                }
                error = sosleep_nsec(head, &head->so_timeo, PSOCK | PCATCH,
-                   "netcon", INFSLP);
+                   "netacc", INFSLP);
                if (error)
                        goto out_unlock;
        }
@@ -428,7 +428,7 @@ sys_connect(struct proc *p, void *v, register_t *retval)
        }
        while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) {
                error = sosleep_nsec(so, &so->so_timeo, PSOCK | PCATCH,
-                   "netcon2", INFSLP);
+                   "netcon", INFSLP);
                if (error) {
                        if (error == EINTR || error == ERESTART)
                                interrupted = 1;
@@ -1651,7 +1651,7 @@ out:
        error = soconnect(so, nam);
        while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) {
                error = sosleep_nsec(so, &so->so_timeo, PSOCK | PCATCH,
-                   "netcon2", INFSLP);
+                   "ypcon", INFSLP);
                if (error)
                        break;
        }