@@ -1896,3 +1896,64 @@ diff Python-3.12.5/Lib/test/_test_multiprocessing.py Python-3.12.8/Lib/test/_tes
1896
1896
> continue # class not intended for this start method.
1897
1897
6254a6457
1898
1898
> Temp.start_method = start_method
1899
+ # ----------------------------------------------------------------------
1900
+ diff Python-3.12.8/Modules/_multiprocessing/semaphore.c Python-3.12.9/Modules/_multiprocessing/semaphore.c
1901
+ 25a26,27
1902
+ > #define _SemLockObject_CAST(op) ((SemLockObject *)(op))
1903
+ >
1904
+ 570c572
1905
+ < semlock_dealloc(SemLockObject* self)
1906
+ ---
1907
+ > semlock_dealloc(PyObject *op)
1908
+ 571a574
1909
+ > SemLockObject *self = _SemLockObject_CAST(op);
1910
+ 709c712
1911
+ < semlock_traverse(SemLockObject *s, visitproc visit, void *arg)
1912
+ ---
1913
+ > semlock_traverse(PyObject *s, visitproc visit, void *arg)
1914
+ diff Python-3.12.8/Lib/multiprocessing/connection.py Python-3.12.9/Lib/multiprocessing/connection.py
1915
+ 849c849
1916
+ < def _get_digest_name_and_payload(message: bytes) -> (str, bytes):
1917
+ ---
1918
+ > def _get_digest_name_and_payload(message): # type: (bytes) -> tuple[str, bytes]
1919
+ diff Python-3.12.8/Lib/multiprocessing/resource_tracker.py Python-3.12.9/Lib/multiprocessing/resource_tracker.py
1920
+ 144a145
1921
+ > prev_sigmask = None
1922
+ 147c148
1923
+ < signal.pthread_sigmask(signal.SIG_BLOCK, _IGNORED_SIGNALS)
1924
+ ---
1925
+ > prev_sigmask = signal.pthread_sigmask(signal.SIG_BLOCK, _IGNORED_SIGNALS)
1926
+ 150,151c151,152
1927
+ < if _HAVE_SIGMASK:
1928
+ < signal.pthread_sigmask(signal.SIG_UNBLOCK, _IGNORED_SIGNALS)
1929
+ ---
1930
+ > if prev_sigmask is not None:
1931
+ > signal.pthread_sigmask(signal.SIG_SETMASK, prev_sigmask)
1932
+ diff Python-3.12.8/Lib/multiprocessing/synchronize.py Python-3.12.9/Lib/multiprocessing/synchronize.py
1933
+ 363c363
1934
+ < def __repr__(self) -> str:
1935
+ ---
1936
+ > def __repr__(self):
1937
+ diff Python-3.12.8/Lib/test/_test_multiprocessing.py Python-3.12.9/Lib/test/_test_multiprocessing.py
1938
+ 5828a5829,5849
1939
+ > @unittest.skipUnless(hasattr(signal, "pthread_sigmask"), "pthread_sigmask is not available")
1940
+ > def test_resource_tracker_blocked_signals(self):
1941
+ > #
1942
+ > # gh-127586: Check that resource_tracker does not override blocked signals of caller.
1943
+ > #
1944
+ > from multiprocessing.resource_tracker import ResourceTracker
1945
+ > orig_sigmask = signal.pthread_sigmask(signal.SIG_BLOCK, set())
1946
+ > signals = {signal.SIGTERM, signal.SIGINT, signal.SIGUSR1}
1947
+ >
1948
+ > try:
1949
+ > for sig in signals:
1950
+ > signal.pthread_sigmask(signal.SIG_SETMASK, {sig})
1951
+ > self.assertEqual(signal.pthread_sigmask(signal.SIG_BLOCK, set()), {sig})
1952
+ > tracker = ResourceTracker()
1953
+ > tracker.ensure_running()
1954
+ > self.assertEqual(signal.pthread_sigmask(signal.SIG_BLOCK, set()), {sig})
1955
+ > tracker._stop()
1956
+ > finally:
1957
+ > # restore sigmask to what it was before executing test
1958
+ > signal.pthread_sigmask(signal.SIG_SETMASK, orig_sigmask)
1959
+ >
0 commit comments