summaryrefslogtreecommitdiff
path: root/mail/evolution/patches/patch-ab
blob: 0e20a47ab8b8f16d0da09e138f36c7c6edf64834 (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
$NetBSD: patch-ab,v 1.5 2003/01/09 13:59:25 rh Exp $

--- mail/main.c.orig	Sat Sep 14 02:53:20 2002
+++ mail/main.c
@@ -36,6 +36,26 @@
 #include "mail.h"
 #include "mail-mt.h"
 
+
+#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__ */
+
 /*#define DO_MCHECK*/
 
 #ifdef DO_MCHECK
@@ -156,6 +176,10 @@ main (int argc, char *argv [])
 	
 	g_print ("Evolution Mail ready and running.\n");
 	
+#ifdef _PTH_PTHREAD_H_
+	gtk_timeout_add (200, pth_nbschedule, NULL);
+#endif
+
 	GDK_THREADS_ENTER ();
 	bonobo_main ();