Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/librumpuser call procexit when a connection closes



details:   https://anonhg.NetBSD.org/src/rev/e026f2b9d312
branches:  trunk
changeset: 760737:e026f2b9d312
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Jan 12 12:52:16 2011 +0000

description:
call procexit when a connection closes

diffstat:

 lib/librumpuser/rumpuser_sp.c |  19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diffs (47 lines):

diff -r 6fd6972d41ec -r e026f2b9d312 lib/librumpuser/rumpuser_sp.c
--- a/lib/librumpuser/rumpuser_sp.c     Wed Jan 12 12:52:13 2011 +0000
+++ b/lib/librumpuser/rumpuser_sp.c     Wed Jan 12 12:52:16 2011 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpuser_sp.c,v 1.34 2011/01/10 19:49:43 pooka Exp $  */
+/*      $NetBSD: rumpuser_sp.c,v 1.35 2011/01/12 12:52:16 pooka Exp $  */
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: rumpuser_sp.c,v 1.34 2011/01/10 19:49:43 pooka Exp $");
+__RCSID("$NetBSD: rumpuser_sp.c,v 1.35 2011/01/12 12:52:16 pooka Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -196,6 +196,15 @@
        return p;
 }
 
+static void
+lwproc_procexit(void)
+{
+
+       spops.spop_schedule();
+       spops.spop_procexit();
+       spops.spop_unschedule();
+}
+
 static int
 rumpsyscall(int sysnum, void *data, register_t *retval)
 {
@@ -456,6 +465,12 @@
        sendunlockl(spc);
        pthread_mutex_unlock(&spc->spc_mtx);
 
+       if (spc->spc_mainlwp) {
+               lwproc_switch(spc->spc_mainlwp);
+               lwproc_procexit();
+               lwproc_switch(NULL);
+       }
+
        /*
         * Nobody's going to attempt to send/receive anymore,
         * so reinit info relevant to that.



Home | Main Index | Thread Index | Old Index