summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-09-16 13:32:45 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-02-09 14:32:55 +0000
commitb5528d7ff526d700aab5b9e11aed871180d4f81e (patch)
treec83168ab9d5cca7235d847ab16028d971acb6592
parentc0d1ffc09b5b008fe9b3ee09330ad663927669af (diff)
downloaddbus-glib-b5528d7ff526d700aab5b9e11aed871180d4f81e.tar.gz
Require a modern libdbus and a modern GLib
This means we can assume that GLib and libdbus are thread-safe by default. Also explicitly document that the object-mapping layer of dbus-glib is not thread-safe. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64214 Reviewed-by: Colin Walters <walters@verbum.org> [with review comments to be fixed in subsequent commit -smcv]
-rw-r--r--configure.ac7
-rw-r--r--dbus/dbus-gthread.c9
-rw-r--r--test/core/Makefile.am6
3 files changed, 8 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index 7891ce6..999e00f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -259,15 +259,12 @@ XML_CFLAGS=
#### Set up final flags
-PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])
+PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.8])
AC_SUBST([DBUS_CFLAGS])
AC_SUBST([DBUS_LIBS])
# Glib detection
-PKG_CHECK_MODULES([DBUS_GLIB], [gobject-2.0 >= 2.26, gio-2.0 >= 2.26])
-PKG_CHECK_MODULES(DBUS_GLIB_THREADS, gthread-2.0 >= 2.6, have_glib_threads=yes, have_glib_threads=no)
-
-AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
+PKG_CHECK_MODULES([DBUS_GLIB], [gobject-2.0 >= 2.32, gio-2.0 >= 2.32, gthread-2.0 >= 2.32])
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)
diff --git a/dbus/dbus-gthread.c b/dbus/dbus-gthread.c
index 5d937b3..a88141b 100644
--- a/dbus/dbus-gthread.c
+++ b/dbus/dbus-gthread.c
@@ -37,14 +37,17 @@
* once and must be called prior to calling any
* other function in the D-BUS API.
*
+ * Equivalent to dbus_threads_init_default(), which does nothing.
+ * dbus-glib requires dbus >= 1.8, which is thread-safe by default.
+ *
+ * Note that dbus-glib's GObject mapping is explicitly *not* thread-safe.
+ *
* Deprecated: New code should use GDBus instead. GDBus is always
* thread-safe, whereas dbus-glib is never thread-safe.
*/
void
dbus_g_thread_init (void)
{
- if (!g_thread_supported ())
- g_error ("g_thread_init() must be called before dbus_threads_init()");
-
+ /* keep this pointless method call just in case */
dbus_threads_init_default ();
}
diff --git a/test/core/Makefile.am b/test/core/Makefile.am
index e4bceb4..2d66355 100644
--- a/test/core/Makefile.am
+++ b/test/core/Makefile.am
@@ -50,7 +50,6 @@ EXTRA_DIST=run-test.sh run-peer-test.sh test-service-glib.xml my-object-marshal.
if DBUS_BUILD_TESTS
-if HAVE_GLIB_THREADS
THREAD_APPS=test-thread-server test-thread-client test-profile
test_thread_server_SOURCES= \
@@ -60,7 +59,6 @@ test_thread_server_SOURCES= \
test_thread_client_SOURCES= \
test-thread-client.c \
test-thread.h
-endif
## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
## build even when not doing "make check"
@@ -183,13 +181,9 @@ CLEANFILES = \
else
### not building tests
-if HAVE_GLIB_THREADS
noinst_PROGRAMS=test-profile
-endif
endif
-if HAVE_GLIB_THREADS
test_profile_SOURCES= \
test-profile.c
-endif