summaryrefslogtreecommitdiff
path: root/glib/gthread-posix.c
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2018-01-31 22:47:49 +0000
committerPhilip Withnall <withnall@endlessm.com>2018-02-06 15:52:29 +0000
commit79d9ea2598c1385104b4c88843d5d92b0203c498 (patch)
tree72ffc25b35976ce082a966a350db566b84bfc1bf /glib/gthread-posix.c
parent1574321e51dc20eb2b0fdd699966428be3cc05eb (diff)
downloadglib-79d9ea2598c1385104b4c88843d5d92b0203c498.tar.gz
gthread: Fix a typo in an #ifdef on the non-native mutex path
This seems to have been present since the code was introduced in commit cedc82290f860683d695d0c5326db153893eec21. The attr variable is defined under one #ifdef, but destroyed under another, which doesn’t make any sense. The second #ifdef variable is actually an enum value, rather than the static initialiser value which makes more sense in the context. Note that GMutex used to be statically initialised to the value of PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP in gthread.h, before this was reworked in commit e081eadda598bc708fbf9dd53a190fc3b0e7fa76. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=793026
Diffstat (limited to 'glib/gthread-posix.c')
-rw-r--r--glib/gthread-posix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/glib/gthread-posix.c b/glib/gthread-posix.c
index 364c9eb24..5fff51477 100644
--- a/glib/gthread-posix.c
+++ b/glib/gthread-posix.c
@@ -105,7 +105,7 @@ g_mutex_impl_new (void)
if G_UNLIKELY ((status = pthread_mutex_init (mutex, pattr)) != 0)
g_thread_abort (status, "pthread_mutex_init");
-#ifdef PTHREAD_ADAPTIVE_MUTEX_NP
+#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
pthread_mutexattr_destroy (&attr);
#endif