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 678223 - g_mutex_free
g_mutex_free
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gthread
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-06-16 19:34 UTC by Behdad Esfahbod
Modified: 2016-03-10 14:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2012-06-16 19:34:21 UTC
I'm replacing code that uses GStaticMutex.  deprecated/gthread.h says:

GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_free) 
void    g_static_mutex_free           (GStaticMutex *mutex); 

However, same file also says:

GLIB_DEPRECATED_IN_2_32 
void            g_mutex_free            (GMutex *mutex); 


I'm confused.  How does one free GMutex resources these days?!
Comment 1 Behdad Esfahbod 2012-06-16 19:38:07 UTC
Ok, I see g_mutex_clear() is supposed to do that.  Which is an awful name, BTW, considering that it doesn't even set mutex->p to NULL.
Comment 2 Behdad Esfahbod 2012-06-19 17:10:02 UTC
How is this not a bug:

GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_free) 
void    g_static_mutex_free           (GStaticMutex *mutex);

Plus, clear should at least set mutex->p to NULL.
Comment 3 Allison Karlitskaya (desrt) 2012-06-19 17:12:37 UTC
Sorry.  I didn't understand the original complaint.

The deprecation note should be fixed, indeed.
Comment 4 Matthias Clasen 2016-03-10 14:01:31 UTC
It has been since 2013.