Commit d041a486 authored by Tor Lillqvist's avatar Tor Lillqvist

Update pthread_mutex_t size and initializer contents to match latest pthreads-Win32.

parent 63cc3f3c
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
......
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
......
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
......
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
......
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
......
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
......
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
......
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
......
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment