[glom/glom-1-18] Avoid calling g_thread_init() if possible.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-18] Avoid calling g_thread_init() if possible.
- Date: Thu, 27 Oct 2011 07:32:33 +0000 (UTC)
commit 03b489ab0e8fb9da8058b70f28fb4b5a462eeabd
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Oct 21 11:33:44 2011 +0200
Avoid calling g_thread_init() if possible.
* configure.ac: Add a comment about not linking to gthread-2.0 in future.
* glom/libglom/init.cc:
* tests/import/test_parsing.cc:
* tests/import/test_signals.cc: Avoid calls to deprecated Glib::thread_init()
if glib is new enough.
This is a step to making Glom build against glibmm from git master with
--enable-warnings=fatal.
Conflicts:
configure.ac
tests/import/test_parsing.cc
tests/import/test_signals.cc
ChangeLog | 12 ++++++++++++
configure.ac | 2 ++
glom/libglom/init.cc | 4 ++++
tests/import/test_parsing.cc | 5 +++++
tests/import/test_signals.cc | 5 +++++
5 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ce3768f..8182acc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-10-21 Murray Cumming <murrayc murrayc com>
+
+ Avoid calling g_thread_init() if possible.
+
+ * configure.ac: Add a comment about not linking to gthread-2.0 in future.
+ * glom/libglom/init.cc:
+ * tests/import/test_parsing.cc:
+ * tests/import/test_signals.cc: Avoid calls to deprecated Glib::thread_init()
+ if glib is new enough.
+ This is a step to making Glom build against glibmm from git master with
+ --enable-warnings=fatal.
+
2011-10-17 Murray Cumming <murrayc murrayc com>
Examples: Remove all column_width attributes now that defaults are good.
diff --git a/configure.ac b/configure.ac
index e84427a..7f044a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,6 +153,8 @@ AC_ARG_ENABLE([maemo-launcher],
# Libraries used by libglom:
# We require libgda >= 4.0.4 because previous versions had case-sensitivity or fatal metastore problems.
# libgda >= 4.1.2 is also OK, but not 4.1.<2.
+# TODO: Remove the need for gthread-2.0 when we can depend on giomm (or glibmm) 3.32,
+# because gthread-2.0 is then just an empty unnecessary library.
REQUIRED_LIBGLOM_LIBS='gthread-2.0 giomm-2.4 libxml++-2.6 >= 2.23.1 pygda-4.0 >= 2.25.3 pygobject-2.0 >= 2.6.0 libgdamm-4.0 >= 4.1.3 libgda-4.0 >= 4.0.4 libgda-postgres-4.0'
AS_IF([test "x$glom_host_win32" != xyes],
diff --git a/glom/libglom/init.cc b/glom/libglom/init.cc
index 5399165..88e5640 100644
--- a/glom/libglom/init.cc
+++ b/glom/libglom/init.cc
@@ -45,8 +45,12 @@ namespace Glom
void libglom_init()
{
+ //Threading is always enabled starting from GLib 2.31.0:
+ //TODO: Just remove this when we can increase the glibmm version needed:
+#if !GLIB_CHECK_VERSION (2, 31, 0)
if (!Glib::thread_supported())
Glib::thread_init(0); //So we can use GMutex.
+#endif
Gnome::Gda::init();
Gio::init();
diff --git a/tests/import/test_parsing.cc b/tests/import/test_parsing.cc
index c16d474..d5290bc 100644
--- a/tests/import/test_parsing.cc
+++ b/tests/import/test_parsing.cc
@@ -91,7 +91,12 @@ void connect_signals(Glom::CsvParser& parser)
// Testcases
int main(int argc, char* argv[])
{
+ //Threading is always enabled starting from GLib 2.31.0:
+ //TODO: Just remove this when we can increase the glibmm version needed:
+#if !GLIB_CHECK_VERSION (2, 31, 0)
Glib::thread_init();
+#endif
+
Gtk::Main gtk(argc, argv);
bool result = true;
diff --git a/tests/import/test_signals.cc b/tests/import/test_signals.cc
index a70b826..1ea3f63 100644
--- a/tests/import/test_signals.cc
+++ b/tests/import/test_signals.cc
@@ -54,7 +54,12 @@ void connect_signals(Glom::CsvParser& parser)
// Testcases
int main(int argc, char* argv[])
{
+ //Threading is always enabled starting from GLib 2.31.0:
+ //TODO: Just remove this when we can increase the glibmm version needed:
+#if !GLIB_CHECK_VERSION (2, 31, 0)
Glib::thread_init();
+#endif
+
Gtk::Main gtk(argc, argv);
bool result = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]