summaryrefslogtreecommitdiff
path: root/mail/evolution/patches/patch-ac
blob: 55b018a85c56961052cafe3a9bd12d4dcea471de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$NetBSD: patch-ac,v 1.5 2002/10/11 09:29:59 rh Exp $

--- shell/main.c.orig	Tue Dec 18 02:21:02 2001
+++ shell/main.c
@@ -63,6 +63,25 @@ static char *evolution_directory = NULL;
 static gboolean no_splash = FALSE;
 extern char *evolution_debug_log;
 
+#ifdef __NetBSD__
+#include <gtk/gtk.h>
+#include <pthread.h>
+
+/*
+ * Pth is non-preemptive, so we yield the processor periodically
+ */
+
+#ifdef _PTH_PTHREAD_H_
+static gint
+pth_nbschedule (gpointer data)
+{
+	sched_yield();
+
+	return TRUE;
+}
+#endif /* _PTH_PTHREAD_H_ */
+#endif /* __NetBSD__ */
+
 
 static GtkWidget *
 quit_box_new (void)
@@ -190,6 +209,10 @@ idle_cb (void *data)
 
 	uri_list = (GSList *) data;
 
+#ifdef _PTH_PTHREAD_H_
+	sched_yield();
+#endif
+
 	shell = e_shell_new (evolution_directory, ! no_splash, &result);
 	g_free (evolution_directory);
 
@@ -350,6 +373,10 @@ main (int argc, char **argv)
 	}
 
 	gtk_idle_add (idle_cb, uri_list);
+
+#ifdef _PTH_PTHREAD_H_
+	gtk_timeout_add (200, pth_nbschedule, NULL);
+#endif
 
 	gtk_widget_push_visual (gdk_rgb_get_visual ());
 	gtk_widget_push_colormap (gdk_rgb_get_cmap ());