]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: PTHREAD_COND_INITIALIZER compatibility with pre-2.41 versions (bug 32786)
authorFlorian Weimer <fweimer@redhat.com>
Thu, 13 Mar 2025 05:07:07 +0000 (06:07 +0100)
committerCarlos O'Donell <carlos@redhat.com>
Tue, 29 Apr 2025 17:26:36 +0000 (13:26 -0400)
The new initializer and struct layout does not initialize the
__g_signals field in the old struct layout before the change in
commit c36fc50781995e6758cae2b6927839d0157f213c ("nptl: Remove
g_refs from condition variables").  Bring back fields at the end
of struct __pthread_cond_s, so that they are again zero-initialized.

Reviewed-by: Sam James <sam@gentoo.org>
(cherry picked from commit dbc5a50d12eff4cb3f782129029d04b8a76f58e7)

sysdeps/nptl/bits/thread-shared-types.h
sysdeps/nptl/pthread.h

index a3d482f80f7d0d35215c166f67905919e020fd96..bccc2003ec6dea5c3fe7fc85c679d33ff8a27131 100644 (file)
@@ -99,6 +99,8 @@ struct __pthread_cond_s
   unsigned int __g1_orig_size;
   unsigned int __wrefs;
   unsigned int __g_signals[2];
+  unsigned int __unused_initialized_1;
+  unsigned int __unused_initialized_2;
 };
 
 typedef unsigned int __tss_t;
index 9af75d6eae090218f422d1a3431d9597f56cc6f1..e0f24418fe4233f0783cc80f1c8c37711c1a2142 100644 (file)
@@ -152,7 +152,7 @@ enum
 
 
 /* Conditional variable handling.  */
-#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0} } }
+#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0}, 0, 0 } }
 
 
 /* Cleanup buffers */