public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/mingw-winpthreads] f45: Add clear_tls.patch
@ 2026-10-20  8:05 Sandro Mani
  0 siblings, 0 replies; only message in thread
From: Sandro Mani @ 2026-10-20  8:05 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/mingw-winpthreads
Branch : f45
Commit : fca76e22a3429eb4aa73be4d884576b7c0ba170e
Author : Sandro Mani <manisandro@gmail.com>
Date   : 2026-10-20T10:03:58+02:00
Stats  : +21/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/mingw-winpthreads/c/fca76e22a3429eb4aa73be4d884576b7c0ba170e?branch=f45

Log:
Add clear_tls.patch

---
diff --git a/clear_tls.patch b/clear_tls.patch
new file mode 100644
index 0000000..1ee9e5f
--- /dev/null
+++ b/clear_tls.patch
@@ -0,0 +1,14 @@
+diff -rupN --no-dereference mingw-w64-v14.0.0/mingw-w64-libraries/winpthreads/src/thread.c mingw-w64-v14.0.0-new/mingw-w64-libraries/winpthreads/src/thread.c
+--- mingw-w64-v14.0.0/mingw-w64-libraries/winpthreads/src/thread.c	2026-03-24 12:26:20.000000000 +0100
++++ mingw-w64-v14.0.0-new/mingw-w64-libraries/winpthreads/src/thread.c	2026-10-20 09:48:35.391884385 +0200
+@@ -1586,6 +1586,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 86f2892..c2f841d 100644
--- a/mingw-winpthreads.spec
+++ b/mingw-winpthreads.spec
@@ -6,7 +6,7 @@
 
 Name:           mingw-winpthreads
 Version:        14.0.0
-Release:        2%{?dist}
+Release:        3%{?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> - 14.0.0-3
+- Add clear_tls.patch
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 14.0.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-20  8:05 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:05 [rpms/mingw-winpthreads] f45: 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