plan9fox/sys
cinap_lenrek f6509078ed lib9p: expose Srv.forker handler and srvforker(), threadsrvforker() and threadsrv() functions
To use srvrease()/srvaquire() we need to have a way to spawn
new processes to handle the service loop. This functionality
was provided by the internal _forker() function which was
eigther rfork or libthread based implementation depending on
if postmountsrv() or threadpostmountsrv() where called.

For servers who want to use srv() directly, _forker would not
be initialized so srvrelease() could not be used.

To untangle this, we get rid of the global _forker handler
and put the handler in the Srv structure. Which will get
initialized (when nil) to eigther srvforker() or threadsrvforker()
depending on if the thread or non-thread entry points where used.

For symmetry, we provde new threadsrv() and threadpostsrv()
functions which handle the default initialization of Srv.forker.

This also allows a user to provide his own forker function,
maybe to conserve stack space.

To avoid dead code, we put each of these function in their
own object file. Note, this also allows a user to define its
own srvforker() symbol.
2021-05-01 16:37:00 +02:00
..
doc
games/lib fortunes: That depends on how you define native. -- Andre Garzia 2021-02-09 23:11:08 -05:00
include lib9p: expose Srv.forker handler and srvforker(), threadsrvforker() and threadsrv() functions 2021-05-01 16:37:00 +02:00
lib printfont: load all fonts for printfont all 2021-04-09 16:09:31 +02:00
man lib9p: expose Srv.forker handler and srvforker(), threadsrvforker() and threadsrv() functions 2021-05-01 16:37:00 +02:00
src lib9p: expose Srv.forker handler and srvforker(), threadsrvforker() and threadsrv() functions 2021-05-01 16:37:00 +02:00