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.6 2003/01/09 13:59:25 rh Exp $
--- shell/main.c.orig Tue Nov 19 07:35:13 2002
+++ shell/main.c
@@ -77,6 +77,25 @@ static gboolean force_upgrade = 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)
@@ -307,6 +326,10 @@ idle_cb (void *data)
else
startup_line_mode = E_SHELL_STARTUP_LINE_MODE_OFFLINE;
+#ifdef _PTH_PTHREAD_H_
+ sched_yield();
+#endif
+
shell = e_shell_new (evolution_directory, ! no_splash, startup_line_mode, &result);
g_free (evolution_directory);
@@ -496,6 +519,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 ());
|