mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-30 04:13:06 +02: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:
parent
73d22207d1
commit
52fd106724
@ -124,7 +124,15 @@ void g_thread_foreach (GFunc thread_func,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl
|
#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 }
|
#define G_STATIC_MUTEX_INIT { NULL }
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GMutex *mutex;
|
GMutex *mutex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user