From 746963318088102ad076c206d0aa95b22109c29e Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 9 Jun 1995 19:49:26 +0000 Subject: (diskfs_spawn_first_thread): Call our own thread function instead of the ports one directly. (master_thread_function): New function. --- libdiskfs/init-first.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'libdiskfs') 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)); } -- cgit v1.2.3