summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-07-22 04:08:26 +0000
committerMiles Bader <miles@gnu.org>1995-07-22 04:08:26 +0000
commit341cb04a7f30fb08a10fa6a604b0efc9561846a7 (patch)
tree4ebf8be1f07518afee7eaded19642718d07b9105
parent874c95aead903bf761ab88a1ffeeaaf2a0e309b4 (diff)
entered into RCS
-rw-r--r--pflocal/sock.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/pflocal/sock.h b/pflocal/sock.h
index eac0e24e..b911582e 100644
--- a/pflocal/sock.h
+++ b/pflocal/sock.h
@@ -26,6 +26,8 @@
#include <hurd/ports.h>
+#include "debug.h"
+
struct pipe;
struct pipe_class;
@@ -97,21 +99,22 @@ error_t sock_create (struct pipe_class *pipe_class, struct sock **sock);
/* Free SOCK, assuming there are no more handle on it. */
void sock_free (struct sock *sock);
+/* Free a sock derefed too far. */
+void _sock_norefs (struct sock *sock);
+
/* Remove a reference from SOCK, possibly freeing it. */
extern inline void
sock_deref (struct sock *sock)
{
+ debug (sock, "lock, refs--");
mutex_lock (&sock->lock);
if (--sock->refs == 0)
- {
- /* A sock should never have an address when it has 0 refs, as the
- address should hold a reference to the sock! */
- assert (sock->addr == NULL);
- sock_free (sock);
- }
+ _sock_norefs (sock);
else
+{debug (sock, "unlock");
mutex_unlock (&sock->lock);
}
+}
/* Return a new socket just like TEMPLATE in SOCK. */
error_t sock_clone (struct sock *template, struct sock **sock);
@@ -145,9 +148,10 @@ error_t addr_get_sock (struct addr *addr, struct sock **sock);
error_t sock_global_init ();
/* Try to shutdown any active sockets, returning EBUSY if we can't. Assumes
- RPCS's have been disabled. */
-error_t sock_global_shutdown (int flags);
+ non-socket RPCS's have been disabled. */
+error_t sock_global_shutdown ();
+/* Mostly here for use by mig-decls.h. */
extern struct port_class *sock_user_port_class;
extern struct port_class *addr_port_class;