aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/main.c
diff options
context:
space:
mode:
authorOlivier Abad <oabad@noos.fr>2003-06-08 09:12:23 +0000
committerOlivier Abad <oabad@noos.fr>2003-06-08 09:12:23 +0000
commitc4c4bb0d1aab4ad513ee35da28217fb952f1e260 (patch)
treea5531f8d43b9cb564deefe529b4f5befa98d4f3a /gtk/main.c
parent84e74c735dddd88e1e33de61826078cc7240bb06 (diff)
Add a "--enable-threads" option, which allows to build the gtk+ v2
ethereal with or without threads. The default is to use threads. (see http://www.ethereal.com/lists/ethereal-dev/200210/msg00111.html and http://www.ethereal.com/lists/ethereal-dev/200306/msg00061.html). svn path=/trunk/; revision=7807
Diffstat (limited to 'gtk/main.c')
-rw-r--r--gtk/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/main.c b/gtk/main.c
index 89304be360..46e3acb1aa 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1,6 +1,6 @@
/* main.c
*
- * $Id: main.c,v 1.295 2003/05/16 00:48:26 guy Exp $
+ * $Id: main.c,v 1.296 2003/06/08 09:12:23 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1337,7 +1337,7 @@ get_ring_arguments(const char *arg)
}
#endif
-#if defined WIN32 || GTK_MAJOR_VERSION < 2
+#if defined WIN32 || GTK_MAJOR_VERSION < 2 || ! defined USE_THREADS
/*
Once every 3 seconds we get a callback here which we use to update
the tap extensions. Since Gtk1 is single threaded we dont have to
@@ -1384,14 +1384,14 @@ update_thread(gpointer data _U_)
void
protect_thread_critical_region(void)
{
-#if ! defined WIN32 && GTK_MAJOR_VERSION >= 2
+#if ! defined WIN32 && GTK_MAJOR_VERSION >= 2 && defined USE_THREADS
g_static_mutex_lock(&update_thread_mutex);
#endif
}
void
unprotect_thread_critical_region(void)
{
-#if ! defined WIN32 && GTK_MAJOR_VERSION >= 2
+#if ! defined WIN32 && GTK_MAJOR_VERSION >= 2 && defined USE_THREADS
g_static_mutex_unlock(&update_thread_mutex);
#endif
}
@@ -1563,7 +1563,7 @@ main(int argc, char *argv[])
}
/* multithread support currently doesn't seem to work in win32 gtk2.0.6 */
-#if ! defined WIN32 && GTK_MAJOR_VERSION >= 2 && defined G_THREADS_ENABLED
+#if ! defined WIN32 && GTK_MAJOR_VERSION >= 2 && defined G_THREADS_ENABLED && defined USE_THREADS
{
GThread *ut;
g_thread_init(NULL);
@@ -1571,7 +1571,7 @@ main(int argc, char *argv[])
ut=g_thread_create(update_thread, NULL, FALSE, NULL);
g_thread_set_priority(ut, G_THREAD_PRIORITY_LOW);
}
-#else /* WIN32 || GTK1.2 || !G_THREADS_ENABLED */
+#else /* WIN32 || GTK1.2 || !G_THREADS_ENABLED || !USE_THREADS */
/* this is to keep tap extensions updating once every 3 seconds */
gtk_timeout_add(3000, (GtkFunction)update_cb,(gpointer)NULL);
#endif /* !WIN32 && GTK2 && G_THREADS_ENABLED */