Bug 44413 - Uses obsolete g_thread API
Summary: Uses obsolete g_thread API
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
URL:
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2012-01-03 01:42 UTC by Martin Pitt
Modified: 2012-01-23 05:54 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (7.59 KB, patch)
2012-01-03 02:05 UTC, Martin Pitt
Details | Splinter Review
proposed patch (7.98 KB, patch)
2012-01-04 07:43 UTC, Martin Pitt
Details | Splinter Review

Description Martin Pitt 2012-01-03 01:42:34 UTC
Both 1.4.x and trunk now fail to build with the current glib 2.31.x:

  CCLD   test-relay
internals/refs.c: In function 'test_connection':
internals/refs.c:279:9: error: 'g_thread_create' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:100): Use 'g_thread_new' instead [-Werror=deprecated-declarations]

[...]

internals/refs.c: In function 'main':
internals/refs.c:598:3: error: 'g_thread_init' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:259) [-Werror=deprecated-declarations]
cc1: all warnings being treated as errors


The g_thread_* API has been deprecated in 2.31.x, and g_thread_init() is not necessary any more since 2.24 (g_type_init() cares about this).
Comment 1 Martin Pitt 2012-01-03 02:05:24 UTC
Created attachment 55069 [details] [review]
proposed patch

This patch works, but it bumps the glib requirement for the tests to 2.31.4 (g_thread_new() did not exist in 2.30.x). If that's not appropriate, I could add some #if magic to emulate g_thread_new() with a macro that calls  g_thread_create() if you are interested.
Comment 2 Simon McVittie 2012-01-04 04:23:38 UTC
(In reply to comment #1)
> If that's not appropriate, I could
> add some #if magic to emulate g_thread_new() with a macro that calls 
> g_thread_create() if you are interested.

For 1.4.x it'd be better to make deprecated declarations non-fatal, or even just silence the warning altogether. 1.4.x is a stable-branch, so it shouldn't have random code churn like this.

For 1.5.x I'd appreciate it if you could do the g_thread_new() emulation if it's fairly easy - if in doubt I tend to use Debian stable as my benchmark of "your distro must be at least this new", and that only has 2.24 - but bumping the dependency for a development branch wouldn't be too bad, especially when it's only for tests anyway.
Comment 3 Simon McVittie 2012-01-04 06:27:03 UTC
(In reply to comment #1)
> This patch works, but it bumps the glib requirement for the tests to 2.31.4

I'd prefer it if this could be avoided, even for 1.5, until 2.32 exists and has ABI stability.
Comment 4 Martin Pitt 2012-01-04 07:43:04 UTC
Created attachment 55115 [details] [review]
proposed patch

Right-o. This updated patch merely bumps the requirement to >= 2.24 for the g_thread_init() part, and uses the real g_thread_new for glib >= 2.31 and a backwards compatibility shim for < 2.31.
Comment 5 Simon McVittie 2012-01-04 08:52:23 UTC
Looks good for 1.5, I'll apply it there soon.
Comment 6 Simon McVittie 2012-01-23 03:58:49 UTC
(In reply to comment #4)
> This updated patch

Applied for 1.5.10, more or less (I also added a comment).

(In reply to comment #2)
> For 1.4.x it'd be better to make deprecated declarations non-fatal, or even
> just silence the warning altogether.

I did this for 1.4.18, and we should reapply this when we branch for 1.6 and any future stable branches.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.