8000 gh-127946: Use a critical section for `CFuncPtr` attributes by ZeroIntensity · Pull Request #128109 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-127946: Use a critical section for CFuncPtr attributes #128109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 20, 2024
Prev Previous commit
Wrap test with catch_threading_exception()
  • Loading branch information
ZeroIntensity committed Dec 20, 2024
commit f682074b2092937a6108b11554fe0a814b1e1b9a
7 changes: 5 additions & 2 deletions Lib/test/test_ctypes/test_cfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,11 @@ def concurrent():
self._dll.tf_b.restype = c_byte
self._dll.tf_b.argtypes = (c_byte,)

with threading_helper.start_threads((Thread(target=concurrent) for _ in range(10))):
pass
with threading_helper.catch_threading_exception() as exc:
with threading_helper.start_threads((Thread(target=concurrent) for _ in range(10))):
pass

self.assertIsNone(exc.exc_value)


# The following repeats the above tests with stdcall functions (where
Expand Down
Loading
0