[gjs] Enable threading by default



commit 3185dfb35f1acec0a6e1388499adeacf13718ded
Author: Johan Dahlin <johan gnome org>
Date:   Wed Dec 9 09:22:22 2009 -0200

    Enable threading by default
    
    There's no simple way to enable threading in a gjs application,
    apart from creating an external module which does it for you.
    As most applications require threads these days it makes sense
    to enable it by default. g_type_init() will soon enable thread
    initializating per default as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=604162

 configure.ac  |    2 +-
 gjs/console.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 604fc54..56141c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -191,7 +191,7 @@ if test "$js_getclass" = no; then
 fi
 
 common_packages="gobject-2.0 >= gobject_required_version $JS_PACKAGE"
-gjs_packages="gmodule-2.0 $common_packages"
+gjs_packages="gmodule-2.0 gthread-2.0 $common_packages"
 gjs_gi_packages="gobject-introspection-1.0 >= 0.6.3 $common_packages"
 gjs_dbus_packages="dbus-glib-1 $common_packages"
 # gjs-tests links against everything
diff --git a/gjs/console.c b/gjs/console.c
index 8572ab3..d9b265b 100644
--- a/gjs/console.c
+++ b/gjs/console.c
@@ -47,6 +47,8 @@ main(int argc, char **argv)
     gsize len;
     int code;
 
+    g_thread_init(NULL);
+
     context = g_option_context_new(NULL);
 
     /* pass unknown through to the JS script */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]