$NetBSD: patch-ab,v 1.3 2002/10/27 07:53:58 rh Exp $ --- src/gtk/gftp-gtk.c.orig Fri Mar 30 12:53:01 2001 +++ src/gtk/gftp-gtk.c @@ -68,6 +68,24 @@ GtkItemFactory * factory = NULL; pthread_mutex_t transfer_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t log_mutex = PTHREAD_MUTEX_INITIALIZER; +#ifdef __NetBSD__ +#include + +#ifdef _PTH_PTHREAD_H_ +#include + +/* + * Pth is non-preemptive, so we yield the processor periodically + */ +gint +pth_nbschedule (gpointer data) +{ + sched_yield(); + return TRUE; +} +#endif +#endif + int main (int argc, char *argv[]) { @@ -119,6 +137,10 @@ main (int argc, char *argv[]) gftp_set_directory (window1.request, startup_directory); gftp_connect (window1.request); ftp_list_files (&window1, 0); + +#ifdef _PTH_PTHREAD_H_ + gtk_timeout_add (200, pth_nbschedule, NULL); +#endif gtk_main (); return (0);