summaryrefslogtreecommitdiff
path: root/sysutils/nautilus/patches/patch-af
blob: 569f517eb2b9a5fa789a2159701e0d3779f7c219 (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-af,v 1.4 2007/11/05 19:10:29 drochner Exp $

--- src/nautilus-main.c.orig	2007-07-24 11:56:20.000000000 +0200
+++ src/nautilus-main.c
@@ -67,6 +67,24 @@
 #include <exempi/xmp.h>
 #endif
 
+#ifdef __NetBSD__
+#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__ */
+
 /* Keeps track of everyone who wants the main event loop kept active */
 static GSList *event_loop_registrants;
 
@@ -538,6 +556,10 @@ main (int argc, char *argv[])
 	} else {
 		/* Run the nautilus application. */
 		application = nautilus_application_new ();
+
+#ifdef _PTH_PTHREAD_H_
+	gtk_timeout_add (200, pth_nbschedule, NULL);
+#endif
 		nautilus_application_startup
 			(application,
 			 kill_shell, restart_shell, no_default_window, no_desktop,