blob: 8dc2c447b349c999583e1863a8bcda90ccdf9425 (
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
|
$NetBSD: patch-ab,v 1.2 2001/05/15 07:56:44 rh Exp $
--- src/gtk/gftp-gtk.c.orig Fri Mar 30 04:53:01 2001
+++ src/gtk/gftp-gtk.c
@@ -68,6 +68,21 @@
pthread_mutex_t transfer_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t log_mutex = PTHREAD_MUTEX_INITIALIZER;
+#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
+
int
main (int argc, char *argv[])
{
@@ -119,6 +134,10 @@
gftp_set_directory (window1.request, startup_directory);
gftp_connect (window1.request);
ftp_list_files (&window1, 0);
+
+#ifdef __NetBSD__
+ gtk_timeout_add (200, pth_nbschedule, NULL);
+#endif
gtk_main ();
return (0);
|