bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 3/3] rumpdisk: Override machdev_server with multithread port mana


From: Damien Zammit
Subject: [PATCH 3/3] rumpdisk: Override machdev_server with multithread port management
Date: Sun, 27 Feb 2022 09:10:41 +0000

---
 rumpdisk/main.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/rumpdisk/main.c b/rumpdisk/main.c
index 8dbe505a..9a353541 100644
--- a/rumpdisk/main.c
+++ b/rumpdisk/main.c
@@ -93,6 +93,21 @@ static struct argp_child empty_argp_children[] = {{0}};
 static struct argp rumpdisk_argp = {options, parse_opt, 0, 0, 
empty_argp_children};
 static const struct argp *rumpdisk_argp_bootup = &rumpdisk_argp;

+static void *
+rumpdisk_multithread_server(void *arg)
+{
+  do
+    {
+      ports_manage_port_operations_multithread (machdev_device_bucket,
+                                               machdev_demuxer,
+                                               1000 * 60 * 2,  /* 2 minute 
thread */
+                                               1000 * 60 * 10, /* 10 minute 
server */
+                                               0);
+    } while (1);
+
+  return NULL;
+}
+
 int
 main (int argc, char **argv)
 {
@@ -122,7 +137,7 @@ main (int argc, char **argv)
     error (1, errno, "cannot lock all memory");

   machdev_device_init ();
-  err = pthread_create (&t, NULL, machdev_server, NULL);
+  err = pthread_create (&t, NULL, rumpdisk_multithread_server, NULL);
   if (err)
     return err;
   pthread_detach (t);
--
2.35.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]