From d041a486182c9d6226e0d568385b2b26b9610171 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 23 Jan 1999 16:21:02 +0000 Subject: [PATCH] Update pthread_mutex_t size and initializer contents to match latest pthreads-Win32. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-12 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ glibconfig.h.win32 | 24 ++++++++++++++++++++++-- 9 files changed, 70 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa00202d..4afded5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Jan 23 16:17:04 1999 Tor Lillqvist + + * glibconfig.h.win32: Update the magic values for + pthread_mutex_t size and initializer bytes to match the + latest version of pthreads for Win32. + Sat Jan 23 02:14:28 1999 Tim Janik * gutils.c (g_get_any_init): cleaned up the errno mess for diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index fa00202d..4afded5e 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Sat Jan 23 16:17:04 1999 Tor Lillqvist + + * glibconfig.h.win32: Update the magic values for + pthread_mutex_t size and initializer bytes to match the + latest version of pthreads for Win32. + Sat Jan 23 02:14:28 1999 Tim Janik * gutils.c (g_get_any_init): cleaned up the errno mess for diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fa00202d..4afded5e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Sat Jan 23 16:17:04 1999 Tor Lillqvist + + * glibconfig.h.win32: Update the magic values for + pthread_mutex_t size and initializer bytes to match the + latest version of pthreads for Win32. + Sat Jan 23 02:14:28 1999 Tim Janik * gutils.c (g_get_any_init): cleaned up the errno mess for diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index fa00202d..4afded5e 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +Sat Jan 23 16:17:04 1999 Tor Lillqvist + + * glibconfig.h.win32: Update the magic values for + pthread_mutex_t size and initializer bytes to match the + latest version of pthreads for Win32. + Sat Jan 23 02:14:28 1999 Tim Janik * gutils.c (g_get_any_init): cleaned up the errno mess for diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index fa00202d..4afded5e 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Sat Jan 23 16:17:04 1999 Tor Lillqvist + + * glibconfig.h.win32: Update the magic values for + pthread_mutex_t size and initializer bytes to match the + latest version of pthreads for Win32. + Sat Jan 23 02:14:28 1999 Tim Janik * gutils.c (g_get_any_init): cleaned up the errno mess for diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index fa00202d..4afded5e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Sat Jan 23 16:17:04 1999 Tor Lillqvist + + * glibconfig.h.win32: Update the magic values for + pthread_mutex_t size and initializer bytes to match the + latest version of pthreads for Win32. + Sat Jan 23 02:14:28 1999 Tim Janik * gutils.c (g_get_any_init): cleaned up the errno mess for diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index fa00202d..4afded5e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Sat Jan 23 16:17:04 1999 Tor Lillqvist + + * glibconfig.h.win32: Update the magic values for + pthread_mutex_t size and initializer bytes to match the + latest version of pthreads for Win32. + Sat Jan 23 02:14:28 1999 Tim Janik * gutils.c (g_get_any_init): cleaned up the errno mess for diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index fa00202d..4afded5e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Sat Jan 23 16:17:04 1999 Tor Lillqvist + + * glibconfig.h.win32: Update the magic values for + pthread_mutex_t size and initializer bytes to match the + latest version of pthreads for Win32. + Sat Jan 23 02:14:28 1999 Tim Janik * gutils.c (g_get_any_init): cleaned up the errno mess for diff --git a/glibconfig.h.win32 b/glibconfig.h.win32 index bf7e6996..bb3848e1 100644 --- a/glibconfig.h.win32 +++ b/glibconfig.h.win32 @@ -87,18 +87,38 @@ typedef unsigned __int64 guint64; #endif #define G_THREADS_ENABLED +/* + * The following program can be used to determine the magic values below: + * #include + * #include + * main(int argc, char **argv) + * { + * int i; + * pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; + * printf ("sizeof (pthread_mutex_t) = %d\n", sizeof (pthread_mutex_t)); + * printf ("PTHREAD_MUTEX_INITIALIZER = "); + * for (i = 0; i < sizeof (pthread_mutex_t); i++) + * printf ("%u, ", (unsigned) ((char *) &m)[i]); + * printf ("\n"); + * exit(0); + * } + */ + typedef struct _GStaticMutex GStaticMutex; struct _GStaticMutex { struct _GMutex *runtime_mutex; union { - char pad[24]; + /* The size of the pad array should be sizeof (pthread_mutext_t) */ + /* This value corresponds to the 1999-01-24 version of pthreads-win32 */ + char pad[36]; double dummy_double; void *dummy_pointer; long dummy_long; } aligned_pad_u; }; -#define G_STATIC_MUTEX_INIT { NULL, { { 0, 0, 0, 0, 0 } } } +/* This should be NULL followed by the bytes in PTHREAD_MUTEX_INITIALIZER */ +#define G_STATIC_MUTEX_INIT { NULL, { { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } #define g_static_mutex_get_mutex(mutex) \ (g_thread_use_default_impl ? ((GMutex*) &(mutex).aligned_pad_u) : \ g_static_mutex_get_mutex_impl (&(mutex).runtime_mutex)) -- 2.34.1