Update pthread_mutex_t size and initializer contents to match latest pthreads-Win32.
authorTor Lillqvist <tml@src.gnome.org>
Sat, 23 Jan 1999 16:21:02 +0000 (16:21 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sat, 23 Jan 1999 16:21:02 +0000 (16:21 +0000)
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glibconfig.h.win32

index fa00202..4afded5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jan 23 16:17:04 1999  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): cleaned up the errno mess for
index fa00202..4afded5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 23 16:17:04 1999  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): cleaned up the errno mess for
index fa00202..4afded5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 23 16:17:04 1999  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): cleaned up the errno mess for
index fa00202..4afded5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 23 16:17:04 1999  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): cleaned up the errno mess for
index fa00202..4afded5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 23 16:17:04 1999  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): cleaned up the errno mess for
index fa00202..4afded5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 23 16:17:04 1999  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): cleaned up the errno mess for
index fa00202..4afded5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 23 16:17:04 1999  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): cleaned up the errno mess for
index fa00202..4afded5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 23 16:17:04 1999  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): cleaned up the errno mess for
index bf7e699..bb3848e 100644 (file)
@@ -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 <stdio.h>
+ * #include <pthread.h>
+ * 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))