$NetBSD: patch-ac,v 1.4 2002/03/16 07:31:26 rh Exp $

--- shell/main.c.orig	Sat Dec 15 07:21:56 2001
+++ shell/main.c
@@ -63,6 +63,23 @@
 static gboolean no_splash = FALSE;
 extern char *evolution_debug_log;
 
+#ifdef __NetBSD__
+#include <gtk/gtk.h>
+#include <pthread.h>
+
+/*
+ * NetBSD uses non-preemptive pth, so we yield the processor periodically
+ */
+
+gint
+pth_nbschedule (gpointer data)
+{
+	pthread_yield_np();
+
+	return TRUE;
+}
+#endif
+
 
 static GtkWidget *
 quit_box_new (void)
@@ -190,6 +207,10 @@
 
 	uri_list = (GSList *) data;
 
+#ifdef __NetBSD__
+	pthread_yield_np();
+#endif
+
 	shell = e_shell_new (evolution_directory, ! no_splash, &result);
 	g_free (evolution_directory);
 
@@ -350,6 +371,10 @@
 	}
 
 	gtk_idle_add (idle_cb, uri_list);
+
+#ifdef __NetBSD__
+	gtk_timeout_add (200, pth_nbschedule, NULL);
+#endif
 
 	gtk_widget_push_visual (gdk_rgb_get_visual ());
 	gtk_widget_push_colormap (gdk_rgb_get_cmap ());
