From d3d6e1d447891889459a691b5cd50fa73fca92d1 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 15 Apr 2021 19:51:59 +0200 Subject: libmachdev: Restore making machdev_trivfs_server blocking netdde actually needs to control which thread runs the trivfs server, for managing per-thread state etc. Only pci-arbiter needs to run machdev_trivfs_server non-blockingly, it can create a thread by itself. * libmachdev/trivfs_server.c (machdev_trivfs_loop): Move back muxer loop to... (machdev_trivfs_server): ... here. * pci-arbiter/main.c (main): Run machdev_trivfs_server in its own thread. * rumpdisk/main.c (main): Do not call pthread_exit(). --- pci-arbiter/main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'pci-arbiter/main.c') diff --git a/pci-arbiter/main.c b/pci-arbiter/main.c index 4f4f13da..b2c37f79 100644 --- a/pci-arbiter/main.c +++ b/pci-arbiter/main.c @@ -243,8 +243,17 @@ main (int argc, char **argv) error (1, err, "Starting the PCI system"); if (disk_server_task != MACH_PORT_NULL) - machdev_trivfs_server(bootstrap); - /* Timer started, quickly do all these next, before we call rump_init */ + { + void *run_server(void *arg) { + machdev_trivfs_server(bootstrap); + return NULL; + } + + pthread_t t; + pthread_create(&t, NULL, run_server, NULL); + pthread_detach(t); + /* Timer started, quickly do all these next, before we call rump_init */ + } if (disk_server_task == MACH_PORT_NULL) underlying_node = netfs_startup (bootstrap, O_READ); -- cgit v1.2.3