summaryrefslogtreecommitdiff
path: root/news/pan/patches/patch-ac
blob: 676d4bcf7d8c1d7ed9bbcc40265ab96177b3fef9 (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
$NetBSD: patch-ac,v 1.2 2001/10/15 07:24:39 rh Exp $

--- pan/pan.c.orig	Thu Oct  4 23:39:24 2001
+++ pan/pan.c
@@ -42,6 +42,24 @@
 #include <pan/thread-watch.h>
 #include <pan/util.h>
 
+#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 gint save_session (GnomeClient        * client,
 			  gint                 phase,
 			  GnomeSaveStyle       save_style,
@@ -198,6 +216,10 @@
 				newsrc_import (s, newsrc_filename, newsrc_port_subscribed_only);
 		}
 	}
+
+#ifdef __NetBSD__
+	gtk_timeout_add (200, pth_nbschedule, NULL);
+#endif
 
 	gtk_main ();