summaryrefslogtreecommitdiff
path: root/libmachdev
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2021-04-15 19:51:59 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-04-15 19:51:59 +0200
commitd3d6e1d447891889459a691b5cd50fa73fca92d1 (patch)
tree39b2d49543748ecb30a8f79d0f24864d52ea4c08 /libmachdev
parent7bcceb243cdb6cb9175a51344b9028370c202845 (diff)
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().
Diffstat (limited to 'libmachdev')
-rw-r--r--libmachdev/trivfs_server.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c
index e0b51529..bbd73555 100644
--- a/libmachdev/trivfs_server.c
+++ b/libmachdev/trivfs_server.c
@@ -557,27 +557,11 @@ trivfs_modify_stat (struct trivfs_protid *cred, io_statbuf_t *stat)
{
}
-static void *
-machdev_trivfs_loop(void *arg)
-{
- struct trivfs_control *fsys = (struct trivfs_control *)arg;
-
- /* Launch. */
- do
- {
- ports_manage_port_operations_one_thread (port_bucket, demuxer, 0);
- } while (trivfs_goaway (fsys, 0));
-
- /* Never reached */
- return 0;
-}
-
void
machdev_trivfs_server(mach_port_t bootstrap)
{
struct trivfs_control *fsys = NULL;
int err;
- pthread_t t;
if (bootstrapping == FALSE)
{
@@ -594,8 +578,11 @@ machdev_trivfs_server(mach_port_t bootstrap)
fsys = control;
}
- err = pthread_create (&t, NULL, machdev_trivfs_loop, (void *)fsys);
- if (err)
- error (1, err, "Creating machdev server thread");
- pthread_detach (t);
+ /* Launch. */
+ do
+ {
+ ports_manage_port_operations_one_thread (port_bucket, demuxer, 0);
+ } while (trivfs_goaway (fsys, 0));
+
+ /* Never reached */
}