summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-10-15 13:21:30 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-10-15 13:21:30 +0200
commita034e629f7611166cae617b08b19667925fc4305 (patch)
tree18e17fddcecf6a3944ee6b2d7741009edf0da062 /sys/include
parent9112daa7641d64bf5b662e9afb391fd267d96ad2 (diff)
lib9p: do not override Srv.end in listensrv(), simplify srvclose() and recounting
listensrv() used to override Srv.end() with its own handler to free the malloc'd Srv structure and close the fd. this makes it impossible to register your own cleanup handler. instead, we introduce the private Srv.free() handler that is used by listensrv to register its cleanup code. Srv.free() is called once all the srv procs have been exited and all requests on that srv have been responded to while Srv.end() is called once all the procs exited the srv loop regardless of the requests still being in flight.
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/9p.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/include/9p.h b/sys/include/9p.h
index 27bec9b9a..d6a830a15 100644
--- a/sys/include/9p.h
+++ b/sys/include/9p.h
@@ -233,8 +233,10 @@ struct Srv {
char* addr;
QLock slock;
- Ref sref;
- Ref rref;
+ Ref sref; /* srvwork procs */
+ Ref rref; /* requests in flight */
+
+ void (*free)(Srv*);
};
void srv(Srv*);