summaryrefslogtreecommitdiff
path: root/libdiskfs/init-first.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-06-09 19:49:26 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-06-09 19:49:26 +0000
commit746963318088102ad076c206d0aa95b22109c29e (patch)
tree590d471d69daa40e78d7854873134f68d0556500 /libdiskfs/init-first.c
parent43f9c85e2ee7b10fe3c118d872f6adf54600ccb7 (diff)
(diskfs_spawn_first_thread): Call our own thread function instead of
the ports one directly. (master_thread_function): New function.
Diffstat (limited to 'libdiskfs/init-first.c')
-rw-r--r--libdiskfs/init-first.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/libdiskfs/init-first.c b/libdiskfs/init-first.c
index ca4b2287..108e765a 100644
--- a/libdiskfs/init-first.c
+++ b/libdiskfs/init-first.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1994 Free Software Foundation
+ Copyright (C) 1994, 1995 Free Software Foundation
This file is part of the GNU Hurd.
@@ -21,10 +21,32 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "priv.h"
+#define THREAD_TIMEOUT 1000 * 60 * 2 /* two minutes */
+#define SERVER_TIMEOUT 1000 * 60 * 10 /* ten minutes */
+
+static void
+master_thread_function (any_t foo __attribute__ ((unused)))
+{
+ error_t err;
+
+ do
+ {
+ ports_manage_port_operations_multithread (diskfs_port_bucket,
+ diskfs_demuxer,
+ THREAD_TIMEOUT,
+ SERVER_TIMEOUT,
+ 1, MACH_PORT_NULL);
+ err = diskfs_shutdown (0);
+ }
+ while (err);
+
+ /* Successful diskfs_shutdown should never return. */
+ abort ();
+}
+
void
diskfs_spawn_first_thread (void)
{
- cthread_detach (cthread_fork ((cthread_fn_t)
- ports_manage_port_operations_multithread,
+ cthread_detach (cthread_fork ((cthread_fn_t) master_thread_function,
(any_t) 0));
}