summaryrefslogtreecommitdiff
path: root/mail/evolution/patches/patch-ab
blob: 2e2be3e26d2c9e09a0235b34bd388eca22b743d7 (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.4 2002/10/11 09:29:59 rh Exp $

--- mail/main.c.orig	Tue Dec 18 02:21:53 2001
+++ 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
@@ -152,6 +172,10 @@ main (int argc, char *argv [])
 		g_mutex_free (gdk_threads_mutex);
 		gdk_threads_mutex = NULL;
 	}
+
+#ifdef _PTH_PTHREAD_H_
+	gtk_timeout_add (200, pth_nbschedule, NULL);
+#endif
 
 	GDK_THREADS_ENTER ();
 	bonobo_main ();