[mono/gtk-sharp] [2 commits] be18f433: glib: do not call g_thread_ functions in GLib >= 2.31

14 views
Skip to first unread message

Mike Kestner (mkestner@gmail.com)

unread,
May 10, 2012, 4:53:08 PM5/10/12
to Mono Patches List

Branch: refs/heads/gtk-sharp-2-12-branch
Home: https://github.com/mono/gtk-sharp
Compare: https://github.com/mono/gtk-sharp/compare/d6ad5db...a14b818

Commit: be18f433b90fa41972cc34a949f198a4365d949a
Author: Andrés G. Aragoneses <kno...@gmail.com> (knocte)
Date: 2012-05-08 21:50:18 GMT
URL: https://github.com/mono/gtk-sharp/commit/be18f433b90fa41972cc34a949f198a4365d949a

glib: do not call g_thread_ functions in GLib >= 2.31

Backport from master ( a446117715187eaea462cdd458314a48b9eb4814 )

Fixes https://bugs.launchpad.net/ubuntu/+source/gtk-sharp2/+bug/935518

Changed paths:
M configure.in.in
M glib/Thread.cs
M glib/glue/thread.c

Modified: configure.in.in
===================================================================
@@ -86,8 +86,6 @@ if test "x$platform_win32" = "xyes"; then
fi

CSDEFINES='@VERSIONCSDEFINES@'
-CSFLAGS="$DEBUG_FLAGS $CSDEFINES $WIN64DEFINES"
-AC_SUBST(CSFLAGS)

GTK_SHARP_VERSION_CFLAGS='@VERSIONCFLAGS@'
AC_SUBST(GTK_SHARP_VERSION_CFLAGS)
@@ -223,6 +221,18 @@ AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_monodoc" = "xyes")
AM_CONDITIONAL(ENABLE_MSI, test "x$enable_msi" = "xyes")
AM_CONDITIONAL(ENABLE_MONOGETOPTIONS, test "x$has_mono" = "xtrue")

+CSFLAGS="$DEBUG_FLAGS $CSDEFINES $WIN64DEFINES"
+
+PKG_CHECK_MODULES(GLIB_2_31,
+ glib-2.0 >= 2.31,
+ HAVE_GLIB_2_31_OR_HIGHER=yes, HAVE_GLIB_2_31_OR_HIGHER=no)
+
+if test "x$HAVE_GLIB_2_31_OR_HIGHER" = "xyes" ; then
+ CFLAGS="$CFLAGS -DDISABLE_GTHREAD_CHECK"
+ CSFLAGS="$CSFLAGS -define:DISABLE_GTHREAD_CHECK"
+fi
+
+AC_SUBST(CSFLAGS)
AC_SUBST(CFLAGS)

AC_OUTPUT([

Modified: glib/Thread.cs
===================================================================
@@ -27,7 +27,18 @@ namespace GLib
public class Thread
{
private Thread () {}
-
+
+#if DISABLE_GTHREAD_CHECK
+ public static void Init ()
+ {
+ // GLib automatically inits threads in 2.31 and above
+ // http://developer.gnome.org/glib/unstable/glib-Deprecated-Thread-APIs.html#g-thread-init
+ }
+
+ public static bool Supported {
+ get { return true; }
+ }
+#else
[DllImport("libgthread-2.0-0.dll")]
static extern void g_thread_init (IntPtr i);

@@ -45,5 +56,7 @@ public static bool Supported
return glibsharp_g_thread_supported ();
}
}
+#endif
+
}
}

Modified: glib/glue/thread.c
===================================================================
@@ -27,6 +27,10 @@
gboolean
glibsharp_g_thread_supported ()
{
+#ifdef DISABLE_GTHREAD_CHECK
+ return true;
+#else
return g_thread_supported ();
+#endif
}


Commit: a14b818bbf145d1ae13d4ec9c2e7bcec66a6513f
Author: Mike Kestner <mkes...@gmail.com> (mkestner)
Date: 2012-05-10 20:52:03 GMT
URL: https://github.com/mono/gtk-sharp/commit/a14b818bbf145d1ae13d4ec9c2e7bcec66a6513f

Merge pull request #42 from knocte/gtk-sharp-2-12-branch

glib: do not call g_thread_ functions in GLib >= 2.31 (2-12 branch)

Changed paths:
M configure.in.in
M glib/Thread.cs
M glib/glue/thread.c

Modified: configure.in.in
===================================================================
@@ -86,8 +86,6 @@ if test "x$platform_win32" = "xyes"; then
fi

CSDEFINES='@VERSIONCSDEFINES@'
-CSFLAGS="$DEBUG_FLAGS $CSDEFINES $WIN64DEFINES"
-AC_SUBST(CSFLAGS)

GTK_SHARP_VERSION_CFLAGS='@VERSIONCFLAGS@'
AC_SUBST(GTK_SHARP_VERSION_CFLAGS)
@@ -223,6 +221,18 @@ AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_monodoc" = "xyes")
AM_CONDITIONAL(ENABLE_MSI, test "x$enable_msi" = "xyes")
AM_CONDITIONAL(ENABLE_MONOGETOPTIONS, test "x$has_mono" = "xtrue")

+CSFLAGS="$DEBUG_FLAGS $CSDEFINES $WIN64DEFINES"
+
+PKG_CHECK_MODULES(GLIB_2_31,
+ glib-2.0 >= 2.31,
+ HAVE_GLIB_2_31_OR_HIGHER=yes, HAVE_GLIB_2_31_OR_HIGHER=no)
+
+if test "x$HAVE_GLIB_2_31_OR_HIGHER" = "xyes" ; then
+ CFLAGS="$CFLAGS -DDISABLE_GTHREAD_CHECK"
+ CSFLAGS="$CSFLAGS -define:DISABLE_GTHREAD_CHECK"
+fi
+
+AC_SUBST(CSFLAGS)
AC_SUBST(CFLAGS)

AC_OUTPUT([

Modified: glib/Thread.cs
===================================================================
@@ -27,7 +27,18 @@ namespace GLib
public class Thread
{
private Thread () {}
-
+
+#if DISABLE_GTHREAD_CHECK
+ public static void Init ()
+ {
+ // GLib automatically inits threads in 2.31 and above
+ // http://developer.gnome.org/glib/unstable/glib-Deprecated-Thread-APIs.html#g-thread-init
+ }
+
+ public static bool Supported {
+ get { return true; }
+ }
+#else
[DllImport("libgthread-2.0-0.dll")]
static extern void g_thread_init (IntPtr i);

@@ -45,5 +56,7 @@ public static bool Supported
return glibsharp_g_thread_supported ();
}
}
+#endif
+
}
}

Modified: glib/glue/thread.c
===================================================================
@@ -27,6 +27,10 @@
gboolean
glibsharp_g_thread_supported ()
{
+#ifdef DISABLE_GTHREAD_CHECK
+ return true;
+#else
return g_thread_supported ();
+#endif
}

Reply all
Reply to author
Forward
0 new messages