[glib] gthread: G_STATIC_MUTEX_INIT: Fix this for the non-win32 case.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gthread: G_STATIC_MUTEX_INIT: Fix this for the non-win32 case.
- Date: Wed, 26 Oct 2011 10:12:20 +0000 (UTC)
commit 52fd106724aa79ad57ecaa7ad9d340f8c89da06d
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Oct 26 11:38:13 2011 +0200
gthread: G_STATIC_MUTEX_INIT: Fix this for the non-win32 case.
Also initialize the unused member. This was correct before but
was broken when the ifndef was moved inside the GStaticMutex
struct:
http://git.gnome.org/browse/glib/commit/glib/gthread.h?id=24652730a9faaedb19b9e90024077eb7f75a6907
This avoids a compiler warning.
glib/deprecated/gthread.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/glib/deprecated/gthread.h b/glib/deprecated/gthread.h
index 095ecc2..987fc90 100644
--- a/glib/deprecated/gthread.h
+++ b/glib/deprecated/gthread.h
@@ -124,7 +124,15 @@ void g_thread_foreach (GFunc thread_func,
#endif
#define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl
+
+#ifndef G_OS_WIN32
+/* The use of PTHREAD_MUTEX_INITIALIZER is arbitrary.
+ * but that struct field is unused anyway. */
+#define G_STATIC_MUTEX_INIT { NULL, PTHREAD_MUTEX_INITIALIZER }
+#else
#define G_STATIC_MUTEX_INIT { NULL }
+#endif
+
typedef struct
{
GMutex *mutex;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]