diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-11-13 17:49:57 +0100 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-11-15 09:28:53 +0100 |
commit | 439f3b8e540a43b5edccebd8d3acc2444d82fc8c (patch) | |
tree | ecc1bd740d95d52b1098f4eb668e92b35c23e6f0 | |
parent | c0541e0f4ae1af9c9f9d6da3ac9252c38935280b (diff) | |
download | glib-439f3b8e540a43b5edccebd8d3acc2444d82fc8c.tar.gz |
Fix 1bit mutex test on platforms with 32 bit aligned pointers
The 1 bit mutex tests asserts: ((gsize) ptrs) % 8, ==, 0), which fails
when the platform only aligns porters to 32 bits (e.g. S390 and
powerpc).
I'm not sure why this assertion was placed here, but given
that internally g_pointer_bit_trylock uses g_atomic_int_or internally
change the assertion so it only requires the alignment to be a multiple
of sizeof(int)
-rw-r--r-- | gthread/tests/1bit-mutex.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gthread/tests/1bit-mutex.c b/gthread/tests/1bit-mutex.c index 0bfce91f0..2a0f6dd3d 100644 --- a/gthread/tests/1bit-mutex.c +++ b/gthread/tests/1bit-mutex.c @@ -62,7 +62,7 @@ acquire (int nr, self = g_thread_self (); - g_assert_cmpint (((gsize) ptrs) % 8, ==, 0); + g_assert_cmpint (((gsize) ptrs) % sizeof(gint), ==, 0); if (!(use_pointers ? g_pointer_bit_trylock (&ptrs[nr], bits[nr]) |