public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/mingw-winpthreads] f44: Add clear_tls.patch
@ 2026-10-20 8:09 Sandro Mani
0 siblings, 0 replies; only message in thread
From: Sandro Mani @ 2026-10-20 8:09 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/mingw-winpthreads
Branch : f44
Commit : bdd088de4e04004d554e8e8e6b7254c2384916f4
Author : Sandro Mani <manisandro@gmail.com>
Date : 2026-10-20T10:09:35+02:00
Stats : +21/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/mingw-winpthreads/c/bdd088de4e04004d554e8e8e6b7254c2384916f4?branch=f44
Log:
Add clear_tls.patch
---
diff --git a/clear_tls.patch b/clear_tls.patch
new file mode 100644
index 0000000..2f157e7
--- /dev/null
+++ b/clear_tls.patch
@@ -0,0 +1,14 @@
+diff -rupN --no-dereference mingw-w64-v13.0.0/mingw-w64-libraries/winpthreads/src/thread.c mingw-w64-v13.0.0-new/mingw-w64-libraries/winpthreads/src/thread.c
+--- mingw-w64-v13.0.0/mingw-w64-libraries/winpthreads/src/thread.c 2025-06-04 07:00:28.000000000 +0200
++++ mingw-w64-v13.0.0-new/mingw-w64-libraries/winpthreads/src/thread.c 2026-10-20 10:09:25.663927541 +0200
+@@ -1580,6 +1580,10 @@ pthread_create_wrapper (void *args)
+ destroying it again in __dyn_tls_thread later on. */
+ tv->p_clock = PTHREAD_MUTEX_INITIALIZER;
+ tv->ended = 1;
++ /* GH #328 experiment: once ended, tv belongs to whoever joins or detaches
++ us, and may be recycled for a new thread before our DLL_THREAD_DETACH
++ runs -- so that callback must not find it through our TLS slot. */
++ TlsSetValue (_pthread_tls, NULL);
+ }
+ while (pthread_mutex_unlock (&mtx_pthr_locked) == 0)
+ Sleep (0);
diff --git a/mingw-winpthreads.spec b/mingw-winpthreads.spec
index be26f65..edef2e0 100644
--- a/mingw-winpthreads.spec
+++ b/mingw-winpthreads.spec
@@ -6,7 +6,7 @@
Name: mingw-winpthreads
Version: 13.0.0
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: MinGW pthread library
# The main license of winpthreads is MIT, but parts of this library
@@ -15,6 +15,9 @@ Summary: MinGW pthread library
License: BSD-3-Clause AND MIT AND LicenseRef-Fedora-Public-Domain
URL: http://mingw-w64.sourceforge.net/
Source0: http://downloads.sourceforge.net/mingw-w64/mingw-w64-v%{version}%{?pre:-%{pre}}.tar.bz2
+# Clear TLS slot to avoid recycled _pthread_v
+# https://sourceforge.net/p/mingw-w64/mingw-w64/ci/c4ec7b6e63fcdcb9d5d9aebd7bf513c28b055cdf/
+Patch0: clear_tls.patch
BuildArch: noarch
@@ -231,6 +234,9 @@ rm -rf /tmp/wine-winpthreads
%changelog
+* Tue Oct 20 2026 Sandro Mani <manisandro@gmail.com> - 13.0.0-4
+- Add clear_tls.patch
+
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 13.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-20 8:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 8:09 [rpms/mingw-winpthreads] f44: Add clear_tls.patch Sandro Mani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox