After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 607481 - Should define G_THREADS_MANDATORY everywhere
Should define G_THREADS_MANDATORY everywhere
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.x
Other Linux
: Normal normal
: 0.10.26
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-19 19:36 UTC by Sebastian Dröge (slomo)
Modified: 2010-01-20 08:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Define G_THREADS_MANDATORY everywhere (3.66 KB, patch)
2010-01-20 05:59 UTC, Sebastian Dröge (slomo)
none Details | Review
build: Define G_THREADS_MANDATORY everywhere (4.19 KB, patch)
2010-01-20 06:23 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2010-01-19 19:36:46 UTC
Hi,
in GLib HEAD there are optimizations now for all the thread functions if G_THREADS_MANDATORY is set. In this case all the mutex, etc calls won't check if threading support is available.

I'd propose to define it at the top of gst.h but maybe another place is better because not everything includes gst.h (most notably gstreamer/gst/*)

Also instead of calling g_thread_supported() in gst_init(), g_thread_get_initialized() should be called after this change.
Comment 1 Tim-Philipp Müller 2010-01-19 20:42:39 UTC
How about

 - adding it to GST_CFLAGS and put it into the .pc file?

and/or

 - adding it to gst_private.h (which does not affect apps of course)
Comment 2 Sebastian Dröge (slomo) 2010-01-20 05:59:57 UTC
Created attachment 151814 [details] [review]
build: Define G_THREADS_MANDATORY everywhere

We require threads to be supported in any case and defining this
will simplify the mutex, condition variable, etc. macros from gthread
to not always check if threads are really supported.

Fixes bug #607481.
Comment 3 Sebastian Dröge (slomo) 2010-01-20 06:00:21 UTC
Like this? :)

Can we get this in 0.10.26?
Comment 4 Olivier Crête 2010-01-20 06:08:49 UTC
g_thread_get_initialized() was added in glib 2.20, and gst only requires 2.18 now. So either add a #ifdef or bump the requirement.
Comment 5 Sebastian Dröge (slomo) 2010-01-20 06:23:37 UTC
Created attachment 151816 [details] [review]
build: Define G_THREADS_MANDATORY everywhere

We require threads to be supported in any case and defining this
will simplify the mutex, condition variable, etc. macros from gthread
to not always check if threads are really supported.

Fixes bug #607481.
Comment 6 Sebastian Dröge (slomo) 2010-01-20 08:52:17 UTC
commit f137d188cb642094bcd21de75e0856907b99dc22
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Wed Jan 20 06:58:28 2010 +0100

    build: Define G_THREADS_MANDATORY everywhere
    
    We require threads to be supported in any case and defining this
    will simplify the mutex, condition variable, etc. macros from gthread
    to not always check if threads are really supported.
    
    Fixes bug #607481.