1
0
mirror of https://gitlab.gnome.org/GNOME/glib.git synced 2025-03-27 01:50:04 +01:00

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.
This commit is contained in:
Murray Cumming 2011-10-26 11:38:13 +02:00
parent 73d22207d1
commit 52fd106724

@ -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;